998 Commits

Author SHA1 Message Date
a9b0020131 Upgraded to shadcnblazor 1.0.13. Added transitive mapping copying and prefixed target to stop any collisions 2026-02-20 09:35:43 +01:00
e3b432aae6 Removed unused startup interface. Added plugin list to frontend plugin initialization 2026-02-20 09:20:29 +01:00
06f27605ba Merge pull request 'Switched from self created static constant json options to a source generator options' (#18) from feat/ImproveJsonSerialization into v2.1
Reviewed-on: #18
2026-02-19 07:50:03 +00:00
0bd138df63 Switched from self created static constant json options to a source generator options 2026-02-19 08:49:23 +01:00
d7b725f541 Merge pull request 'Improved plugin loading and handling' (#17) from feat/ImprovePluginLoading into v2.1
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 51s
Reviewed-on: #17
2026-02-19 07:36:06 +00:00
0f26aaf803 Added options for navigation assemblies for the router 2026-02-19 08:32:32 +01:00
c45e177001 Improved handling of moonlight plugins during startup, minimized host project code and moved startup handling to core 2026-02-18 15:36:45 +01:00
627e9bb161 Merge pull request 'Switched to SimplePlugin plugin loader' (#16) from feat/SwitchPluginLoader into v2.1
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 50s
Reviewed-on: #16
2026-02-18 12:57:22 +00:00
1fc33ebf03 Switched to SimplePlugin plugin loader 2026-02-18 13:21:15 +01:00
64e4d7201e Removed test code from ApiKeySchemeHandler 2026-02-14 15:31:47 +01:00
816aa01319 Implemented plugin referencing. Added healthcheck and custom base docker image 2026-02-13 08:38:33 +01:00
5627e78843 Merge pull request 'Implemented theme import and export' (#15) from feat/ThemeExportImport into v2.1
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 50s
Reviewed-on: #15
2026-02-12 14:47:50 +00:00
795cec149f Switched from nodejs to bun for building tailwindcss 2026-02-12 15:46:05 +01:00
83fcb4a921 Merge pull request 'Implemented hybrid cache with redis support' (#14) from feat/HybridCache into v2.1
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 53s
Reviewed-on: #14
2026-02-12 14:30:21 +00:00
741a60adc6 Implemented hybrid cache for user sessions, api keys and database provided settings. Cleaned up startup and adjusted caching option models for features 2026-02-12 15:29:35 +01:00
6f941a220c Implemented theme import and export 2026-02-12 11:09:38 +01:00
dd44e5bb86 Merge pull request 'Added api key expiry' (#13) from feat/ApiKeys into v2.1
Reviewed-on: #13
2026-02-12 09:11:45 +00:00
7b38662f8f Added cache key format for api key validation 2026-02-12 09:59:47 +01:00
6d854d82d3 Made username table cell clickable to open edit screen and removed the unnecessary text-left 2026-02-11 20:46:59 +01:00
ac1c28d20d Implemented user logout and deletion service. Added Auth, Deletion and Logout hook. Restructed controllers 2026-02-11 20:46:53 +01:00
5efe591f85 Started implementing api key expiration 2026-02-09 16:12:11 +01:00
4daf986f3e Added option for oidc to disable https only cookies for deployments using an ip 2026-02-09 12:22:03 +01:00
cc7f55c988 Added versions and instance permissions to default admin perms 2026-02-09 12:03:29 +01:00
11a2f9818a Added buns lockfile to gitignore 2026-02-09 12:02:58 +01:00
6a151394a7 Added type hints in display name of version selector 2026-02-09 10:27:36 +01:00
178ac5ac20 Added permissions for container helper. Updated rebuild version selection to fetch the available versions from moonlights version api 2026-02-09 09:14:38 +01:00
91944a5ef6 Updated setup page to use the latest shadcnblazor input fields 2026-02-09 08:22:58 +01:00
affdadf3aa Merge branch 'feat/ContainerHelper' into v2.1
Some checks failed
Dev Publish: Nuget / Publish Dev Packages (push) Failing after 31s
# Conflicts:
#	Moonlight.Api/Services/ApplicationService.cs
#	Moonlight.Api/Startup/Startup.Base.cs
#	Moonlight.Shared/Http/SerializationContext.cs
2026-02-09 08:18:56 +01:00
8d9a7bb8b3 Added validation to setup dto 2026-02-09 06:51:38 +00:00
1f631be1c7 Updated settings service to support generic types with JSON serialization/deserialization, adjusted setup wizard checks and modified database schema for proper JSONB storage. 2026-02-09 06:51:38 +00:00
5b4959771c Started implementing setup wizard backend for initial instance configuration. Adjusted ui 2026-02-09 06:51:38 +00:00
b8e1bbb28c Added setup wizard component for initial installation flow and integrated it into app routing. 2026-02-09 06:51:38 +00:00
c8fe11bd2b Implemented version fetching from source control git server. Added self version detection and update checks 2026-02-01 14:47:32 +01:00
09b11cc4ad Improved update instance model text design 2026-01-29 14:07:02 +01:00
660319afec Renamed SharedSerializationContext to SerializationContext. Added error handling and no build cache functionality 2026-01-29 13:59:24 +01:00
8181404f0c Moved request and responses dtos to correct namespace 2026-01-29 12:45:09 +01:00
e1207b8d9b Refactored container helper service. Cleaned up event models. Implemented version changing. Added security questions before rebuild 2026-01-29 11:23:07 +01:00
97a676ccd7 Implemented handling of server side issues using the rfc for problem detasils in the frontend 2026-01-29 09:28:50 +01:00
136620f1e6 Updated all forms to use the EnhancedEditForm and blazors native validation. Fixed smaller issues after upgrading to ShadcnBlazor 1.0.11 2026-01-29 08:58:12 +01:00
9b11360a0e Added vesrion to update instance dialog. Added apply functionality to instance page. Replaced dialog launch in overview to link to instance tab 2026-01-28 16:43:29 +01:00
deb69e6014 Upgraded to ShadcnBlazor 1.0.10. Started implementing instance management ui page 2026-01-26 16:49:25 +01:00
4e96905fb2 Implemented container helper status checked. Started implementing container helper ui. Improved update modal 2026-01-25 22:51:51 +01:00
e2f344ab4e Added container rebuild flow with real-time logs and updated UI, backend implementation, config options, and container helper API integration. 2026-01-23 16:38:42 +01:00
76a8a72e83 Moved the applying of selected permissions to the correct place in the role dialogs 2026-01-19 11:06:48 +01:00
3e302198a2 Removed unused launchSettings.json and unnecessary folder reference from project file to clean up configuration.
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 45s
2026-01-19 10:58:55 +01:00
4187f9da4e Implemented frontend configuration service and dynamic theme reloading integration. Updated sidebar to display dynamic application name.
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 48s
2026-01-19 10:55:34 +01:00
d85b07bde7 Upgraded ShadcnBlazor and Extras to 1.0.9. Replaced Checkbox with Switch for "Is Enabled" fields and updated CSS editor language to Css. 2026-01-19 10:24:05 +01:00
3cbdd3b203 Implemented theme crud and basic theme loading 2026-01-18 23:31:01 +01:00
56b14f60f1 Implementing api key authentication scheme and validation. Added default value in dtos 2026-01-17 21:05:20 +01:00
01c86406dc Implemented API key management with permission checks, database schema, and frontend integration. Adjusted string lengths for Role and API key attributes. 2026-01-16 15:06:45 +01:00
a28b8aca7a Added permission checks to all controllers. Added role permission loading. Added frontend permission checks. Implemented user logout in admin panel. 2026-01-16 13:07:19 +01:00
bee381702b Added session caching for user validation to reduce db calls and introduced configurable session options. 2026-01-16 09:19:15 +01:00
10cd0f0b09 Implemented member management of roles. Moved users controller 2026-01-15 14:52:29 +01:00
fcaa0dcd07 Migrated user management views to modal-based dialogs, restructured roles, and user pages under /admin/users. Simplified navigation paths and improved tabbed interface. 2026-01-15 12:26:49 +01:00
ea35ddb0dc Added build step for frontend in NuGet publishing workflow to ensure class list files generate properly 2026-01-15 11:45:06 +01:00
b4536ca6e9 Upgraded ShadcnBlazor and Extras to 1.0.8, adjusted styles import paths, and adjusted frontend build process.
Some checks failed
Dev Publish: Nuget / Publish Dev Packages (push) Failing after 23s
2026-01-15 10:59:40 +01:00
7f482fd6c3 Refactored response and request models to dto naming. Adjusted mapper naming 2026-01-14 19:19:45 +01:00
1d1dfc2c1c Adjusted sideoffset of dropdown menu on users page 2026-01-14 19:08:04 +01:00
a197d7d980 Improved diagnose accordium UIs 2026-01-14 19:05:42 +01:00
06063b94b3 Implemented roles and action timestamps. Added oermissions selector and interfaces 2026-01-14 19:03:17 +01:00
43d43a6d7d Adjusted compose file from template to match moonlight 2026-01-14 19:01:05 +01:00
1849cda2f5 Added npm install command to nuget publishing action 2026-01-14 16:19:37 +01:00
f836657603 Implemented Tailwind CSS class list extraction and integrated it into the build process of the frontend package
Some checks failed
Dev Publish: Nuget / Publish Dev Packages (push) Failing after 16s
2026-01-14 16:10:06 +01:00
7e0b427137 Added Gitea workflow for publishing NuGet packages and configured project files for NuGet packaging
All checks were successful
Dev Publish: Nuget / Publish Dev Packages (push) Successful in 41s
2026-01-14 13:36:36 +01:00
b79c8fe476 Added current tab as query parameter to system page 2025-12-30 16:07:08 +01:00
f71bad3da3 Upgraded ShadcnBlazor to 1.0.5 2025-12-30 16:06:33 +01:00
170cac2091 Minor design improvements to user table and diagnose page 2025-12-30 16:06:18 +01:00
ba942b2f8f Made sidebar item collection extendable via interface. Refactored settings to system 2025-12-27 23:54:48 +01:00
05c05f1b72 Adjusted config options for oidc and database to use the correct section 2025-12-27 23:34:00 +01:00
ec6782160c Added update model with progress animations. Backend not implemented 2025-12-27 23:33:33 +01:00
1581276854 Adjusted dockerfile for library-host architecture 2025-12-27 23:32:54 +01:00
e1c0645428 Added diagnose frontend and backend implementation 2025-12-27 23:32:36 +01:00
be3cdb8235 Added settings option model. Recreated migrations 2025-12-25 22:02:12 +01:00
bfc7d9993a Refactored pages to correct locations 2025-12-25 22:00:59 +01:00
ca69d410f2 Added small system overview 2025-12-25 21:55:46 +01:00
a2d4edc0e5 Recreated solution with web app template. Improved theme. Switched to ShadcnBlazor library 2025-12-25 19:16:53 +01:00
0cc35300f1 Updated mooncore styles. Adjusted theme editor and theme loading. Changed versions Upgraded mooncore.blazor.flyonui. Made moonlight flyonui/daisyui compatible 2025-10-27 08:23:02 +00:00
2f21806bea Upgraded mooncore. Regenerated mappings. Updated versions 2025-10-20 20:42:54 +02:00
c5d75a8710 Updated package versions 2025-10-20 17:30:00 +00:00
f3dd37f649 Removed pull request trigger from nuget build action 2025-10-20 17:27:59 +00:00
b035dd6b76 Added filter for csproj files for nuget package publish action 2025-10-20 17:26:46 +00:00
34c4bb8cb7 Updated theme and styles 2025-10-20 19:19:11 +02:00
de5c9f4ea1 Upgraded mooncore deendencies 2025-10-20 19:19:11 +02:00
9ab69ffef5 Upgraded mooncore versions. Cleaned up code, especially startup code. Changed versions 2025-10-05 16:07:27 +00:00
d2ef59d171 Merge pull request #457
Updated dependencies. Refactored to async scheme
2025-09-21 19:24:11 +02:00
8e2b333f47 Updated Moonlight nuget versions. Regenrated mappings 2025-09-21 17:20:33 +00:00
594fb3073f Updated to latest mooncore version for xml docs 2025-09-21 17:17:21 +00:00
3e87d5c140 Switched to database scheme seperation from MoonCores SingleDb. Updated mooncore versions. Updating to correct Async naming 2025-09-21 16:44:01 +00:00
86bec7f2ee Updated to latest mooncore version. Cleaned up some crud controllers and replaced DataTable with the new DataGrid component 2025-09-16 12:09:20 +00:00
8e242dc8da Merge pull request #456
Implemented SignalR (+ Scaling)
2025-09-16 10:04:20 +02:00
efca9cf5d8 Implemented SignalR scaling using redis. Improved diagnose report generator. Added SignalR debug card in Diagnose page 2025-09-16 08:02:53 +00:00
8573fffaa2 Updated dependencies. Changed version. Fixed small file manager archive format issue 2025-09-06 18:42:28 +02:00
51aeb67ad6 Improved paged endpoint rage validation. Fixed smaller request model validation issues 2025-08-26 01:52:43 +02:00
5e371edf2b Updated versions 2025-08-26 01:30:45 +02:00
d46ad72cb6 Merge pull request #454 from Moonlight-Panel/v2.1_FileManager
Extended file manager to support the new interfaces for downloading via url. Improved the handling of compressing and decompressing. Separated file manager controllers. Updated mooncore versions
2025-08-26 01:09:17 +02:00
a6ae2aacfb Extended file manager to support the new interfaces for downloading via url. Improved the handling of compressing and decompressing. Seperated file manager controllers. Updated mooncore versions 2025-08-26 01:07:59 +02:00
dc862e4b3c Removed unused pwa build option from razor class library project 2025-08-24 11:59:00 +02:00
e56c5edfb4 Merge pull request #453
Implemented theme importing and exporting
2025-08-23 23:43:06 +02:00
70b310adef Implemented theme importing and exporting 2025-08-23 23:39:56 +02:00
6748288f3c Merge pull request #452 from Moonlight-Panel/v2.1_OpenTelemetry
Added open telemetry exporter to existing metric system. Improved config section for metrics
2025-08-23 22:57:19 +02:00
2c5d45e9c2 Added open telemetry exporter to existing metric system. Improved config section for metrics 2025-08-23 22:09:00 +02:00
c02c13bf90 Bumped versions 2025-08-23 20:25:08 +02:00
902ca114c1 Merge pull request #451 from Moonlight-Panel/v2.1_ImproveAuth
Improved authentication
2025-08-20 17:20:10 +02:00
17cd039c9b Improved design of login method selection screen 2025-08-20 17:16:19 +02:00
26f955fce2 Added extendability to the sign-in / sync, the session validation and the frontend claims transfer calls 2025-08-20 17:01:42 +02:00
3cc48fb8f7 Updated MoonCore dependencies. Switched to asp.net core native authentication scheme abstractions. Updated claim usage in frontend 2025-08-20 16:16:31 +02:00
60178dc54b Implemented user deletion service and IUserDeleteHandler for plugins to hook into 2025-08-19 21:35:43 +02:00
8a63a3448a Removed old bg-gray-900 from register and login razor pages 2025-08-19 21:18:37 +02:00
f5336f63ce Rewritten build and publish steps because github's nuget registry is not compatible with previous used action 2025-08-10 16:16:57 +02:00
97583349df Added plugins.props files for plugin references. Fixed small tailwind mapping issue. Adjusted actions file to publish packages correctly again. Updated versions 2025-08-10 16:02:10 +02:00
9bec336323 Merge remote-tracking branch 'origin/v2_ChangeArchitecture' into v2_ChangeArchitecture 2025-07-24 09:24:06 +02:00
123b64a666 Cleaned up pagination in user and apikey controller. Extracted login start and start url generation to modular IOAuth2Provider interface. Improved login and register local oauth2 page 2025-07-24 09:24:00 +02:00
5a215231fa Cleaned up pagination in user and apikey controller. Extracted login start and start url generation to modular IOAuth2Provider interface. Improved login and register local oauth2 page 2025-07-24 09:23:36 +02:00
6a29b5386c Merge remote-tracking branch 'origin/v2_ChangeArchitecture' into v2_ChangeArchitecture 2025-07-24 08:33:29 +02:00
7cd138b09f Improved ui/ux of theme pages. Upgraded mooncore.blazor.flyonui 2025-07-23 22:58:16 +02:00
504837fe77 Fixed color inconsistency 2025-07-23 09:49:52 +02:00
7dde1d86f8 Added theme loading. Improved theme editor. Updated app theme model 2025-07-22 21:08:03 +02:00
a480ae9c50 Renamed theme tab to customisation tab. Added basic theme crud 2025-07-21 22:16:34 +02:00
2c9a87bf3e Expanding theme tab to customization tab. Started improving theme selection. 2025-07-20 23:27:51 +02:00
03ea94b858 Merge remote-tracking branch 'origin/v2_ChangeArchitecture' into v2_ChangeArchitecture 2025-07-19 00:20:07 +02:00
9e42985ec8 Added helper message component (not final). Improved stat card design. Started improving theme preview 2025-07-19 00:20:00 +02:00
dbf17aee3b Removed ace editor build from moonlight. Using the one from mooncore now. Bumped up versions 2025-07-18 08:39:54 +02:00
2b91d9a798 Updated mooncore version. Fixed checkbox ui in diagnose page. Bumped nuget version 2025-07-17 22:50:21 +02:00
74d18419a6 Bumped nuget versions to 2.1.4 2025-07-17 21:49:27 +02:00
e3f007b568 Merge pull request #446 from Moonlight-Panel/v2.1_TwClassExport
Fixed oauth2 controller. Improved tw export. Fixed gh action
2025-07-17 21:47:26 +02:00
6690f09a32 Updated mappings import. Fixed github action 2025-07-17 21:44:31 +02:00
7c496b4c7f Fixed oauth2 controller returning invalid data. Adjusted build seps for tailwind class map 2025-07-16 20:48:49 +02:00
77abdd807d Merge pull request #445 from Moonlight-Panel/v2.1_OptimizeNugetBuilding
Optimize nuget building. Refactored startup. Fixed smaller issues
2025-07-14 21:09:21 +02:00
7599a7d60a Merge remote-tracking branch 'origin/v2.1_OptimizeNugetBuilding' into v2.1_OptimizeNugetBuilding 2025-07-14 21:07:34 +02:00
14993b9fe7 Refactored startup. Removed unused usings. Improved nuget package building. Switched to yaml for configuration. Moved asset files. Set correct context type for oauth2 pages. Updated versions 2025-07-14 21:07:13 +02:00
acba3a9f53 Refactored startup. Removed unused usings. Improved nuget package building. Switched to yaml for configuration. Moved asset files. Set correct context type for oauth2 pages. Updated versions 2025-07-14 21:06:54 +02:00
2b62fc141d Refactored startup. Updated usings. Removed dockerignore 2025-07-14 19:25:08 +02:00
4baa0bbe77 Adjusted tailwind style building to work with class name extraction 2025-07-14 14:40:10 +02:00
d88376f2fb Refactored css classes to match flyonui. Switched to postgres arrays for permissions. Migrated file manager. Adjusted everything to work with the latest mooncore version 2025-07-12 23:53:43 +02:00
eaece9e334 Separating runtime from application code to improve building. Upgraded mooncore packages. Started switching to flyonui. Added PluginFramework plugin loading via mooncore 2025-07-11 17:13:37 +02:00
7e158d48c6 version bumped 2025-07-03 21:41:07 +02:00
4ed153ac5b Fixed MainLayout so "h-full" can be used in Pages. 2025-07-03 21:03:42 +02:00
6b17296139 Fixed formatting in workflow. Fixed invalid image link in readme 2025-06-08 16:52:57 +02:00
bb5dffe395 Fixed dotnet tool not being discovered due to missing path env 2025-06-08 00:47:49 +02:00
ole
0fa844f856 hopefully fixed now 2025-06-08 00:42:18 +02:00
ole
4fea77c837 Added new Publish workflow 2025-06-08 00:10:21 +02:00
f76c797a7f Added skip duplicate option to push to prevent pushing the same version 2025-06-07 22:07:30 +02:00
ad81fd9199 Merge remote-tracking branch 'origin/v2_ChangeArchitecture' into v2_ChangeArchitecture 2025-06-07 22:04:39 +02:00
f732c80230 Added missing property to scripts csproj 2025-06-07 22:04:16 +02:00
eb97d15f03 Merge pull request #444 from Moonlight-Panel/v2_ChangeArchitecture_workflows
First iteration of development packages workflow
2025-06-07 21:47:00 +02:00
be590d8e2b First iteration of development packages workflow 2025-06-07 21:40:38 +02:00
a41845e45c Removed outdated workflows. Removed used docker file and compose file. Updated readme 2025-06-01 20:49:19 +02:00
a1cb4f243a Added missing input validation in oauth2 register request 2025-06-01 15:34:17 +02:00
110e055e24 Upgraded Swashbuckle.AspNetCore to 8.1.2 2025-06-01 11:48:27 +02:00
f3a35bd62a Started implementing metrics system 2025-05-23 17:15:19 +02:00
565d9a5a4d Upgraded mooncore.blazor.tailwind 2025-05-23 10:37:01 +02:00
dbc29046f5 Fixed memory usage detection for linux 2025-05-23 10:36:37 +02:00
0152502c1b Updated mooncore version. Fixed tailwind forms plugin layering issues. Added tags input for permissions for api keys and users 2025-05-22 20:36:22 +02:00
0520e3d7e5 Added separate build script to package.json for the docker image to use 2025-05-22 20:16:35 +02:00
dc49e168ab Updated mooncore versions. Updated permission checking. Added client side permission check. Added dotnet tool specifications for scripts project 2025-05-21 10:30:37 +02:00
da55f2b19e Merge pull request #440 from Moonlight-Panel/v2_ChangeArchitecture_AddDiagnose
Added diagnose system
2025-05-17 19:41:32 +02:00
424f2a8779 Merge branch 'v2_ChangeArchitecture' into v2_ChangeArchitecture_AddDiagnose 2025-05-17 19:40:50 +02:00
255bfba9e3 Cleaned up diagnose system. Fixed smaller inconsistencies 2025-05-17 19:38:36 +02:00
593a79c506 Merge pull request #442 from Moonlight-Panel/v2_ChangeArchitecture_FirstUserAdmin
Implemented first user admin feature
2025-05-17 18:07:15 +02:00
d4a7600c14 Cleaned up scripts project 2025-05-17 18:04:59 +02:00
mxritzdev
7ead76fbcc Implemented First User Admin Feature 2025-05-17 17:53:05 +02:00
mxritzdev
f87e4a0800 censored client id config diagnose 2025-05-15 14:15:44 +02:00
mxritzdev
eab03d7f5a cleaned up diagnose feature 2025-05-15 14:09:16 +02:00
9dc77e6dde Workaround for https://github.com/dotnet/aspnetcore/issues/59291 2025-05-15 10:14:44 +02:00
3a804c99ce Upgraded to dotnet 9 2025-05-15 09:45:54 +02:00
mxritzdev
c49b000521 Used CamelCase Formatter in Diagnose ui 2025-05-14 20:15:07 +02:00
mxritzdev
ebc1b9441e changed the diagnose to be easier to use 2025-05-14 20:13:24 +02:00
0e5402c347 Removed unused calls and classes from the old plugin system 2025-05-14 09:15:18 +02:00
6922242b4f Disabled generation of packages during build. Re-enabled trimming in the client 2025-05-13 21:46:29 +02:00
73ca5e57e8 Added nuget directory option to pack command of the script 2025-05-13 21:17:49 +02:00
a579dd4759 Finished compile time plugin loading. Refactored plugin loading. Extended build helper script 2025-05-13 20:48:50 +02:00
mxritzdev
609a0297d5 moved diagnose to own controller, added advanced diagnose building, ui for advanced still missing 2025-05-13 17:22:47 +02:00
mxritzdev
0743bad93c added ui for the diagnose system 2025-05-13 15:28:46 +02:00
mxritzdev
49848db96f added logs to the diagnose 2025-05-13 14:26:29 +02:00
mxritzdev
ba736d2b19 added file logging and log rotation 2025-05-13 14:14:22 +02:00
mxritzdev
753cb04dfe improved the config in the diagnose 2025-05-13 14:06:59 +02:00
mxritzdev
bc25210fe4 added config to diagnose, while censoring sensitive data 2025-05-12 19:36:27 +02:00
mxritzdev
a4e0175173 finished diagnose system 2025-05-12 19:00:09 +02:00
moritz
bd8ea67017 zip extracts now, still some issues with the ressource building 2025-05-12 16:51:29 +02:00
8126250d1a Implemented tag based run helper script 2025-05-11 22:26:05 +02:00
moritz
8ac2d20d8a added base diagnose, is not working, yet, still contains test objects 2025-05-11 13:03:44 +02:00
1b4d32eed3 Prepared tailwind system for plugin builds and exports via nuget. Removed obsolete old css bundling. Added helper scripts for building. Rewritten build scripts 2025-05-11 00:07:41 +02:00
1a67fcffb4 Added nuget export options for development. Added nuget patch script for dotnet-script 2025-05-08 17:10:41 +02:00
bbc6c0fbd3 Upgraded to latest mooncore packages. Upgraded to tailwind v4 2025-05-02 13:06:09 +02:00
6657bae0cd Improved api key ux 2025-04-15 13:42:30 +02:00
65ea5985d3 Implement disabling of local oauth2 controller 2025-04-15 13:08:28 +02:00
7defc9a6a9 Removed legacy and testing options from compose 2025-04-15 13:03:38 +02:00
504cb8e950 Implemented modular oauth2 system 2025-04-15 13:03:13 +02:00
f81b84e4b3 Cleaned up swagger controller 2025-04-15 13:02:45 +02:00
c12e1e38b8 Implemented user permission update 2025-04-15 12:32:29 +02:00
db7ac8d174 Removed unused middleware. Fixed plugin loading issues 2025-04-15 12:19:32 +02:00
0b0c9304b1 Added oauth2 access endpoint override option 2025-04-14 22:36:37 +02:00
f56f592c4c Added distroless dockerfile. Updated docker compose 2025-04-14 22:35:38 +02:00
b0fe27c643 Removed left over rider files 2025-04-14 22:07:08 +02:00
55bc825cb7 Added hangfire. Implemented hangfire statistics. Updated lucide icons 2025-04-09 20:24:31 +02:00
7fa46ef245 Removed use of crud helper. Refactored user and api key response. Removed unused request/response models 2025-04-05 14:56:26 +02:00
e1c0722fce Updated sidebar and header 2025-03-30 17:54:07 +02:00
3f511cefa8 Updated loader style so the table loader is working again 2025-03-24 21:20:21 +01:00
f1adba4fa6 Updated to latest mooncore version 2025-03-24 20:35:42 +01:00
a9d3a30782 Fixed overwriting issue for chunked file upload 2025-03-20 20:50:05 +01:00
55a8cfad46 Implemented chunked uploading. Updated mooncore 2025-03-20 16:23:27 +01:00
420ff46ceb Improved upload progress tracking. Fixed path on frontend export 2025-03-17 10:53:45 +01:00
75f037da02 Implemented frontend hosting file generation helper 2025-03-16 22:03:01 +01:00
1238095f09 Moved resources. Added placeholder pfp 2025-03-14 17:15:43 +01:00
3084bb268b Implemented proper mobile sidebar. Fixed mobile view of api key page. Removed unused exception 2025-03-14 15:12:36 +01:00
f1c0d3b896 Implemented api authentication. Removed old secret system 2025-03-14 12:32:13 +01:00
340cf738dc Updated mooncore dependencies. Improved ux for the system file manager 2025-03-13 12:18:13 +01:00
f23320eb1c Added max file size upload option. Switched from stream upload to multipart form content file upload 2025-03-07 13:31:30 +01:00
9fb1667bf0 Updated mooncore dependencies 2025-03-06 20:55:14 +01:00
1f95577eb7 Updated mooncore.extended. Adjusted authentication config to support multiple schemes 2025-03-01 17:35:21 +01:00
45ccb6fc4c Fixed oauth2 configuration loading 2025-02-28 11:03:54 +01:00
b1092985ff Updated mooncore versions. Removed unused imports and legacy configuration loading 2025-02-28 09:55:47 +01:00
6c5e4c2a1e Fixed bundling. Upgraded mooncore.extended 2025-02-26 22:32:02 +01:00
caa8d47af2 Simplified plugin service and loading 2025-02-26 17:06:25 +01:00
cdc4744f28 Added theme saving. Added interfaces for overview pages. Renamed sidebar interface function 2025-02-26 13:09:31 +01:00
f4a0aabb61 Finished migration to postgresql. Updated mooncore package 2025-02-26 09:23:57 +01:00
64f4a3a58c Started migrating to postgresql 2025-02-25 17:12:31 +01:00
a23c3b0fdd Added comments
<3
2025-02-24 21:02:32 +01:00
3dd5d2958a Implemented plugin loading via di on the api server. Fixed plugin loading in the client 2025-02-24 20:03:37 +01:00
69df761bf4 Implemented plugin interface loading via di
1^
2025-02-24 17:20:16 +01:00
4a571e1944 Updated theme 2025-02-17 06:46:59 +01:00
fa86b26f46 Upgraded npm package. Made update view paths shorter 2025-02-08 18:14:42 +01:00
480d118014 Implemented system files tab 2025-02-06 10:56:49 +01:00
2e5d0dcd73 Added new mooncore js dependencies. Added ace editor build 2025-02-05 16:50:35 +01:00
b6b488edf6 Updated mooncore dependency usage 2025-02-05 14:08:40 +01:00
bf5a744499 Starting updating mooncore dependency usage 2025-02-04 17:09:07 +01:00
1a4864ba00 Added theming support. Added import/export
Missing: API Server save
2025-01-08 00:33:09 +01:00
e299cde6da Removed asset controllers. Started adding design section in settings 2025-01-07 00:08:19 +01:00
8372cfad1b Started implementing fronted configuration. Upgraded mooncore. Made database calls asnyc 2025-01-06 22:36:21 +01:00
d477e803ab Upgraded mooncore packages. Added css variables for theming. Made all db calls use async/await 2025-01-04 10:37:40 +01:00
bf89ef16f7 Upgraded MoonCore 2024-12-20 14:29:54 +01:00
744d977454 Upgraded frontend dependencies 2024-12-20 01:50:41 +01:00
b95f89687f Updated mooncore tailwind dependency 2024-12-17 22:43:43 +01:00
143ba3c138 Fixed app startup issue in frontend for dev server 2024-12-13 20:11:45 +01:00
094af845a0 Added app startup for the frontend 2024-12-13 18:46:10 +01:00
5efeb5fba6 Created powershell variant of the nuget cache helper script 2024-12-11 09:09:42 +01:00
42ab052699 Added helper script 2024-12-10 22:30:06 +01:00
e6c9feed6b Fixed bundle generation service 2024-12-10 22:29:53 +01:00
e63a3db8b9 Added css bundle api. Improved css bundling code
I made the code cleaner as requested @Masu-Baumgartner  :>
2024-12-10 21:25:46 +01:00
75cefea4fa Implemented download service 2024-12-10 19:52:14 +01:00
150a18cc0b Implemented css bundling 2024-12-10 16:28:11 +01:00
64b20e26ac Created a nuget build script for developers using windows 2024-12-05 13:55:58 +01:00
f08c8f013d Upgraded dependencies 2024-12-05 13:11:58 +01:00
721570927f Automated nuget package build
So you don't have to do it manually every time
2024-12-01 22:22:07 +01:00
62fe6089f7 Improved asset service. Removed now unused plugin asset streaming endpoint 2024-12-01 20:04:29 +01:00
0a76e64d2f Added AssetService. Added command line handling for assets. Added asset streaming on the client 2024-12-01 18:34:08 +01:00
2e98d166ec Changed icons to use Lucide icons 2024-12-01 18:00:13 +01:00
Masu-Baumgartner
bc737c830f Started adding asset api/auto import 2024-11-26 17:33:51 +01:00
Masu-Baumgartner
23a74bdfc6 Fixed plugin loader usage. Improved export for nuget. Changed css name 2024-11-21 17:03:38 +01:00
Masu-Baumgartner
f702167d6e Fixed api exception handler 2024-11-21 09:41:53 +01:00
Masu-Baumgartner
fe31c01a06 Upgraded packages. Improved startup. Removed unused components 2024-11-20 17:21:17 +01:00
Masu-Baumgartner
2d0a0e53c0 Implementing plugin loading for api server and client 2024-11-19 16:28:25 +01:00
Masu Baumgartner
072adb5bb1 Working on module/plugin system 2024-11-14 22:30:02 +01:00
Masu-Baumgartner
e5555c815b Cleanud up auth code 2024-11-12 10:29:50 +01:00
Masu-Baumgartner
a074f0c4f0 Testing new oauth2 setup 2024-11-11 16:46:51 +01:00
Masu Baumgartner
d92f996169 Started adding module service
I will probably change the api paths and a lot of other stuff i wrote today tomorrow :|
2024-11-10 22:06:19 +01:00
Masu Baumgartner
96bb3a5c0f Preparations for plugin/module development 2024-11-10 20:36:02 +01:00
Masu Baumgartner
18810766ed DevServer things :> 2024-11-08 23:53:06 +01:00
Masu Baumgartner
764ebe3586 Implemented system overview 2024-11-08 14:49:49 +01:00
Masu Baumgartner
add4c3e99f Fixed smaller issues with refreshing the access token on frontend side
+ Saving the access and refresh token on server side
2024-11-07 00:42:23 +01:00
Masu Baumgartner
f9c4ec1d31 Completed adjustments for the new configuration of oauth2 and token auth 2024-11-06 20:03:18 +01:00
Masu-Baumgartner
f2d653563c Adjusting to use new extension methods to configure and handle token auth and oauth2 2024-11-06 16:46:24 +01:00
Masu Baumgartner
288b0c8d97 Started testing oauth2 handler from mooncore 2024-11-05 22:46:26 +01:00
Masu-Baumgartner
69e5e1c75b Removed unused file. Fixed typo 2024-11-05 16:35:24 +01:00
Masu-Baumgartner
399fbbaab5 Started testing a dx friendlier oauth2 handler 2024-11-04 16:34:29 +01:00
Masu Baumgartner
06f7731011 Implemented register functionality 2024-11-03 20:55:40 +01:00
Masu Baumgartner
81d8bc45ee Improved caching to exclude server side only resources 2024-11-03 19:21:46 +01:00
Masu Baumgartner
17a4e7ec14 Added option to disable the client hosting of the api server 2024-11-03 19:20:51 +01:00
Masu Baumgartner
b73c3ebfb3 Started with docker compose config. Switched to new config system. Upgraded mooncore packages 2024-11-03 01:30:53 +01:00
Masu-Baumgartner
b0a044db97 Implemented apex charts for visualisation
The fill animations is buggy
2024-10-30 15:54:48 +01:00
Masu-Baumgartner
fce44f49b6 Implemented apikey backend 2024-10-30 13:34:19 +01:00
Masu-Baumgartner
6d0c75ceff Smaller ui adjustments 2024-10-29 16:13:53 +01:00
Masu-Baumgartner
324bf6891a Implemented api key crud and started adding system page. Added 404 page 2024-10-29 15:42:20 +01:00
Masu-Baumgartner
e5f29e4725 Added fancy start page greeting 2024-10-29 09:22:18 +01:00
Masu-Baumgartner
54e0675ba9 Improved default log level definition 2024-10-29 09:22:05 +01:00
Masu Baumgartner
e02af774a9 Cleaned up the startup sequence. 2024-10-28 21:30:00 +01:00
Masu-Baumgartner
f6ed12fc7a Upgraded MoonCore packages. Small ui improvement 2024-10-28 15:04:07 +01:00
Masu Baumgartner
c15f18108d Changed auth success ui. Switched to new interface service. Upgraded mooncore versions 2024-10-27 20:49:06 +01:00
Masu Baumgartner
7239182e83 Changed colors......
I am an absolute mess when it comes to frontend. I cannot settle on a design :c
2024-10-25 23:22:34 +02:00
Masu Baumgartner
eba6e00251 Improved oauth2 ui design 2024-10-25 15:49:03 +02:00
Masu Baumgartner
6f3341e6ad Switched to LocalStorage. Upgraded MoonCore. Improved auth flow 2024-10-23 21:37:26 +02:00
Masu Baumgartner
910f190c86 Completed first iteration of access-refresh auth. Upgraded mooncore. Refactored mooncore related stuff 2024-10-21 20:17:59 +02:00
Masu Baumgartner
c4c3d1bd60 Implemented better ux for the oauth2 workflow
Still wip
2024-10-20 01:05:46 +02:00
Masu Baumgartner
f166de1a43 Implemented complete oauth2 flow with modular providers
The local oauth2 provider still needs A LOT of love. But the general oauth2 workflow works. The http api client needs an option to disable the authentication things and we need to switch to the local storage for storing access, refresh and timestamp for the client
2024-10-19 20:09:03 +02:00
Masu Baumgartner
71dc81c4dc Reorganized config. Re implemented auth controller to use token-pair authentication and oauth2 2024-10-19 19:27:22 +02:00
Masu Baumgartner
8883b521e9 Started implementing client and api server auth and the refresh endpoint 2024-10-19 16:37:37 +02:00
Masu Baumgartner
6be3b8338d Improved token handling and used new validate auth request for oauth2 2024-10-18 13:11:02 +02:00
Masu Baumgartner
9d1351527d Started implementing oauth2 based on MoonCore helper services
Its more or less a test how well the helper services improve the implementation. I havent implemented anything fancy here atm. Just testing the oauth2 flow
2024-10-18 00:03:20 +02:00
Masu-Baumgartner
13daa3cbac Started testing tag component 2024-10-09 16:25:33 +02:00
Masu-Baumgartner
19afc5d055 Added permissions to users controller and the client. 2024-10-07 16:37:18 +02:00
Masu-Baumgartner
bb29177e41 Merge branch 'v2_ChangeArchitecture' of https://github.com/Moonlight-Panel/Moonlight into v2_ChangeArchitecture 2024-10-07 12:05:18 +02:00
Masu Baumgartner
f48e5d4b19 Implemented admin crud ui for users page. Fixed some smaller issues 2024-10-06 20:44:18 +02:00
Masu Baumgartner
cf25e4e1e6 Implemented admin users crud api 2024-10-06 01:19:23 +02:00
Masu-Baumgartner
966e67afee Adjusted header to use identity service values 2024-10-04 09:30:20 +02:00
Masu-Baumgartner
a0432eec68 Improved PWA options. Fully implemented auth 2024-10-02 16:31:23 +02:00
Masu Baumgartner
522d0c1471 Added app loaders and screen for the ui. Added identity service. Started auth screens 2024-10-01 21:02:55 +02:00
Masu Baumgartner
ca1b7a84c9 Merge branch 'v2_ChangeArchitecture' of https://github.com/Moonlight-Panel/Moonlight into v2_ChangeArchitecture 2024-10-01 20:17:18 +02:00
Masu-Baumgartner
e32e35d3af Implemented api/check endpoint. Added api error middleware 2024-10-01 14:27:09 +02:00
Masu-Baumgartner
ef2e6c9a20 Added login/register function. Implemented authentication. Started authorization 2024-10-01 11:29:19 +02:00
Masu Baumgartner
fa748494f6 Small changes 2024-09-30 20:50:21 +02:00
Masu-Baumgartner
73bf27d222 Removed old architecture. Added new base project structure 2024-09-30 17:52:14 +02:00
Ole Sziedat
c05ea18513 Updated .net version to 8.0 2024-07-19 19:15:56 +02:00
Masu Baumgartner
23dc3495f1 Fixed old use of WButton 2024-07-10 19:00:15 +02:00
Masu Baumgartner
bdcacdf6b7 Fix register ui not working 2024-07-08 23:48:46 +02:00
Marcel Baumgartner
c0ff47e478 Fixed old usage of WButton in file manager 2024-07-07 16:45:28 +02:00
Marcel Baumgartner
6d0a59f5b9 Added support for arm while building scss 2024-07-06 22:03:35 +02:00
Marcel Baumgartner
a56adfed8a Disabled dynamic settings for now 2024-07-06 14:09:21 +02:00
Marcel Baumgartner
a2a520e9fd Changed pereodic reauth to be disabled for now 2024-07-06 13:17:51 +02:00
Marcel Baumgartner
bd189caf80 Removed unused constructor. Added default value for empty commit hash 2024-07-06 13:16:10 +02:00
Marcel Baumgartner
333346889d Fixed commit hash shortening 2024-07-06 13:04:49 +02:00
Marcel Baumgartner
26ba7e0ef6 Fixed smaller issues with image ui 2024-07-06 12:12:53 +02:00
Masu Baumgartner
5e61526218 Merge pull request #434 from Moonlight-Panel/v2_UpgradeMoonCore
Upgrade to new MoonCore version
2024-07-06 11:41:34 +02:00
Masu Baumgartner
ae2634f57e Merge branch 'v2' into v2_UpgradeMoonCore 2024-07-06 11:41:13 +02:00
Marcel Baumgartner
583aeb9225 Switched back to the nuget version of MoonCore.Blazor 2024-07-06 11:38:21 +02:00
Marcel Baumgartner
dcef6e4500 Switched to new mooncore authentication service 2024-07-06 11:29:45 +02:00
Marcel Baumgartner
e53a1bad0e Upgraded the last forms to the new mooncore version 2024-07-05 20:09:45 +02:00
Marcel Baumgartner
3f0ade7fb2 Fixed node allocations refresh 2024-07-05 17:28:45 +02:00
Marcel Baumgartner
e778b3ebae Testing some stuff with mooncore 2024-07-05 17:28:33 +02:00
Marcel Baumgartner
f54e5d8716 Switched to nuget version of mooncore 2024-07-04 11:24:44 +02:00
Marcel Baumgartner
90b8b00ef6 Fixed small bug 2024-07-04 11:24:18 +02:00
Marcel Baumgartner
9602a201ce Switched to final fast forms implementation. Changed some stuff 2024-07-03 22:38:40 +02:00
Marcel Baumgartner
ba907d5499 Upgraded servers page to new mooncore version 2024-06-30 19:15:32 +02:00
Marcel Baumgartner
1eb63d7a8c Adjusted the length of the commit sha to look like on github 2024-06-30 02:47:48 +02:00
Marcel Baumgartner
1cca9457ee Reduced commit hash string in ui 2024-06-30 02:35:35 +02:00
Marcel Baumgartner
20b67eafe1 Fixed typo and added dates back to devbuild workflow 2024-06-30 02:32:57 +02:00
Marcel Baumgartner
4e1f1629a1 Updated workflows (again) 2024-06-30 02:22:47 +02:00
Marcel Baumgartner
2eac1b3c78 Updated workflows 2024-06-30 02:16:12 +02:00
Marcel Baumgartner
a895372e13 Corrected failing scss compiling 2024-06-30 02:02:33 +02:00
Marcel Baumgartner
52b3616de4 Included scss compiling using sass in the docker image 2024-06-30 01:52:17 +02:00
Marcel Baumgartner
caa7bb2af6 Moved theme to asset api 2024-06-30 01:52:00 +02:00
Marcel Baumgartner
a8bb2aa000 Updated git ignore to include new theme path 2024-06-30 01:51:40 +02:00
Marcel Baumgartner
c6d88fe7bf Improved version detecting 2024-06-30 01:51:20 +02:00
Marcel Baumgartner
48e84e815b Fixed arm restore issue. Thanks microsoft for NOT documenting this in the correct issue 2024-06-30 00:54:54 +02:00
Marcel Baumgartner
d821ce43b5 Switched to github actions runner from self hosted 2024-06-30 00:54:08 +02:00
Marcel Baumgartner
83c40ec417 Adjusted image conversion helper to be compatible with the latest egg changes 2024-06-29 19:05:41 +02:00
Marcel Baumgartner
fcfbf5a01d Added missing return statement for file check 2024-06-29 19:03:04 +02:00
Masu Baumgartner
f924bcfcc6 Updated development-build.yml 2024-06-28 13:29:36 +02:00
Marcel Baumgartner
9d9717df61 Upgraded build push action version. Changed ubuntu version 2024-06-28 11:55:55 +02:00
Masu Baumgartner
1b6bc61263 Merge pull request #433 from Moonlight-Panel/v2_AddedVersioning
V2 added versioning
2024-06-28 11:38:31 +02:00
Marcel Baumgartner
650b993325 Added github actions 2024-06-28 11:37:09 +02:00
Marcel Baumgartner
1525215757 Added versioning 2024-06-28 11:36:45 +02:00
Marcel Baumgartner
9eb9e047e1 Added auto refresh to image import 2024-06-27 12:01:41 +02:00
Marcel Baumgartner
326bd09662 Upgraded server images to new mooncore forms 2024-06-27 11:50:44 +02:00
Marcel Baumgartner
53509ecf63 Fixed smaller issues. Upgraded server node ui 2024-06-26 10:59:14 +02:00
Marcel Baumgartner
95a5eafec2 Upgraded server networks and api keys 2024-06-25 23:19:27 +02:00
Marcel Baumgartner
2838a91e3c Upgraded users, sessions and settings page 2024-06-25 17:52:58 +02:00
Marcel Baumgartner
7fcd674b7f Improved mysql container boot state error handling 2024-06-24 19:30:20 +02:00
Masu Baumgartner
d9d17c8342 Allow changing of multipart form upload limit 2024-06-22 20:03:27 +02:00
Marcel Baumgartner
42e9f18fb6 Made moonlight able to compile and somehwat run with MoonCore.Blazor and the new logging system 2024-06-22 11:28:58 +02:00
Masu Baumgartner
7c2db9bb00 Upgrade .net version of the docker image to 8 2024-06-21 19:54:59 +02:00
Masu Baumgartner
2060b9140f Merge pull request #432 from Moonlight-Panel/v2
Update branch v2_UpgradeMoonCore with latest commits
2024-06-21 19:49:07 +02:00
Masu Baumgartner
ed33678f50 Merge pull request #431 from Moonlight-Panel/v2_AdminApi
Added admin api system
2024-06-21 19:48:08 +02:00
Masu Baumgartner
63cf9c758d Merge pull request #429 from Moonlight-Panel/v2_ShowFilesWhichWillGetDeleted
Popup listing some of the files which will be deleted
2024-06-18 23:54:59 +02:00
Moritz Deiaco
efe37d2dd7 Saved Counts in a variable 2024-06-14 19:16:53 +02:00
Moritz Deiaco
a12e2be0e7 Now, the popup is listing some of the files which will be deleted 2024-06-14 11:13:47 +02:00
Masu Baumgartner
7870baed08 Merge pull request #428 from Moonlight-Panel/v2_FixUserDashCards
Fixed Server & Network Counts
2024-06-13 21:24:29 +02:00
Masu Baumgartner
4e6b75d167 Merge pull request #425 from Moonlight-Panel/v2_AddCookieConsentBanner
V2 add cookie consent banner
2024-06-13 21:24:06 +02:00
Moritz Deiaco
38b93cd500 Cookie consent is disabled by default 2024-06-13 17:39:02 +02:00
Moritz Deiaco
04422b94d0 Fixed Server & Network Counts 2024-06-13 17:30:03 +02:00
Masu Baumgartner
be3a5fb6c3 Merge pull request #427 from Moonlight-Panel/v2_ImproveNodeFqdnValidation
Improved the node fqdn validation
2024-06-12 19:47:41 +02:00
Marcel Baumgartner
8b5270d2ed Improved the node fqdn validation 2024-06-12 19:47:22 +02:00
Masu Baumgartner
173361bc2b Merge pull request #426 from Moonlight-Panel/v2_FixDockerImageIndex
Added manual sorting for the docker images by id so the index matches always and does not depend on the mood of ef core
2024-06-12 19:38:51 +02:00
Marcel Baumgartner
09d6da4ad3 Added manual sorting for the docker images by id so the index matches always and does not depend on the mood of ef core
I probably will add a global mapping for it in the data context
2024-06-12 19:36:46 +02:00
Moritz Deiaco
862b43ae6d Fixed some dump mistakes 2024-06-09 10:33:04 +02:00
Masu Baumgartner
b1854c1a30 Merge pull request #419 from Moonlight-Panel/v2_ModularUiImprovements
V2 modular UI improvements
2024-06-09 02:03:29 +02:00
Moritz Deiaco
a0f256946e I forgot the {get; set;} 2024-06-08 12:16:56 +02:00
Moritz Deiaco
8b489da287 Updated the styling for the cookieconsent banner 2024-06-08 12:08:48 +02:00
Moritz Deiaco
87f93b3cab Added Cookie Settings option on the account settings 2024-06-08 12:02:00 +02:00
Moritz Deiaco
0fd60b5ccb Added the cookie consent banner 2024-06-08 11:45:39 +02:00
Masu Baumgartner
ebe1c0b2df Merge pull request #423 from Moonlight-Panel/v2_FixHeaderName
Fixed Header Username
2024-06-06 18:22:11 +02:00
Moritz Deiaco
addb71c558 Fixed Header Username
The header always showed @masuowo, now it shows the users username.
2024-06-06 18:15:56 +02:00
Baumgartner Marcel
b7a21ceb94 Added new profile icon 2024-06-06 15:31:07 +02:00
Baumgartner Marcel
67b201e7c5 Add check for existing /bin path in entrypoint 2024-06-06 12:41:04 +02:00
Baumgartner Marcel
1254925c4a Implemented api permission system (backend) 2024-06-06 08:59:52 +02:00
Baumgartner Marcel
1cc32fa5c4 Started adding api permission check 2024-06-05 16:20:24 +02:00
Baumgartner Marcel
77d24ed90f Small ui adjustment 2024-06-05 15:51:21 +02:00
Baumgartner Marcel
d2d2463164 Added api keys and api ui 2024-06-05 15:44:47 +02:00
Baumgartner Marcel
2bb3b0fd48 Added api documentation/definition system system 2024-06-05 13:27:09 +02:00
Baumgartner Marcel
e43d6bff06 Upgraded to dotnet 8 2024-06-05 11:26:33 +02:00
Marcel Baumgartner
4401a91d35 Improved error handling when converting and sending server configurations to daemon 2024-06-03 20:04:01 +02:00
Masu Baumgartner
fc863cc422 Merge pull request #422 from Moonlight-Panel/v2_ImproveForms
Changed dotnet version. Improved allocation display function
2024-05-31 12:00:09 +02:00
Masu Baumgartner
dd3724b4de Switched dotnet version. Upgraded mooncoreui. Added better allocation display function
Dotnet version has been changed because it caused build errors. We change it back to dotnet 8 when every dependency in relation with blazor (mooncore, mooncoreui) has been updated
2024-05-31 11:58:42 +02:00
Masu Baumgartner
dc1b35fbe0 Merge pull request #421 from Moonlight-Panel/v2
Update ImproveForms with latest commits from the main branch
2024-05-31 11:18:04 +02:00
Marcel Baumgartner
d62af84dfd Upgraded to MoonCoreUI 1.1.9 2024-05-30 19:01:44 +02:00
Marcel Baumgartner
b5119b6be1 Fixed server creation allocation loading 2024-05-30 18:27:36 +02:00
Moritz Deiaco
ac5890f115 Fixed Loading Mistake 2024-05-30 18:17:25 +02:00
Marcel Baumgartner
96a906b717 Removed test pages 2024-05-30 18:15:39 +02:00
Masu Baumgartner
02da555028 Merge pull request #420 from Moonlight-Panel/v2_ImproveForms
Improved forms with new MoonCore features
2024-05-30 18:14:18 +02:00
Marcel Baumgartner
4d4eb6e640 Switched to released 1.1.8 2024-05-30 18:07:22 +02:00
Marcel Baumgartner
0dd24f1e7f Improved admin server crud 2024-05-30 17:56:38 +02:00
Moritz Deiaco
20d0e1c8eb Used OnAfterRender instead of OnInitialized 2024-05-30 14:13:42 +02:00
Marcel Baumgartner
dfb633f6a7 Updated mooncore usage to work with the newer version 2024-05-30 13:34:24 +02:00
Masu Baumgartner
0ff0ce1252 Testing custom loaders 2024-05-29 21:24:45 +02:00
Moritz Deiaco
09dffe020d Improved Nodes Card 2024-05-29 20:55:23 +02:00
Moritz Deiaco
f3a5a8de25 Added User Dashboard Informations 2024-05-29 20:42:17 +02:00
Moritz Deiaco
d107164d7d Improved card ui 2024-05-29 18:28:45 +02:00
Moritz Deiaco
fd76a085dc Added a cool node status card onto the admin dashboard 2024-05-29 18:19:35 +02:00
Moritz Deiaco
7a9708137c Fixed a small spacing issue on the admin page 2024-05-29 17:58:29 +02:00
Moritz Deiaco
13a49d3306 Added a permssion requirement to the servercount card 2024-05-29 17:31:43 +02:00
Moritz Deiaco
6fa91d8890 Added a Minimum Required Permission Level For the component
Masu you said it would be possible to handle this in the Components Razor file, but if nothing is shown there will still be an empty space (empty cols are still showing in boostrap, margin on the userdashboard  and admindashboard components). I think this would be the best solution
2024-05-29 16:27:46 +02:00
Marcel Baumgartner
a580e4335b More testing of the new mooncore ui changes 2024-05-28 22:43:46 +02:00
Masu Baumgartner
a4080cc1b1 Merge pull request #418 from Moonlight-Panel/v2_UpdateToDotnet8
Upgraded moonlight to dotnet 8
2024-05-27 14:32:46 +02:00
Masu Baumgartner
4f5a4913d7 Upgraded moonlight to dotnet 8 2024-05-27 14:32:16 +02:00
Marcel Baumgartner
83f453da3f Switched to new loader 2024-05-26 22:43:16 +02:00
Masu Baumgartner
c340e48f02 Merge pull request #415 from Moonlight-Panel/v2_addNodeOnlineCheckOnServerDeploy
Added node online check on server create
2024-05-23 14:37:26 +02:00
Marcel Baumgartner
61492bc669 Testing display name property 2024-05-23 08:18:10 +02:00
Masu Baumgartner
6264a15b1d Testing and developing new mooncore features with moonlight as a test env 2024-05-22 16:57:37 +02:00
Masu Baumgartner
257af8106d Merge pull request #417 from Moonlight-Panel/v2_ImproveModularUI
Made user dashboard modular and extendable via plugins
2024-05-21 21:50:43 +02:00
Moritz
6eedc8aba9 Renamed the Implementation 2024-05-21 14:12:46 +02:00
Moritz
cba98bdf6f Made Index page Modular
Made Index Page editable with the Plugin System, added greeting Component
2024-05-20 09:07:06 +02:00
Marcel Baumgartner
d2da868b71 Updated to use the new mooncore version 2024-05-19 20:37:54 +02:00
Masu Baumgartner
685221b454 Merge pull request #416 from Moonlight-Panel/v2_ResponsivenessImprovements
Improved responsive behaviour
2024-05-19 15:33:08 +02:00
Moritz
f12e5f10d5 Improved Server Ui responsivity 2024-05-19 15:20:24 +02:00
Moritz
cc7b4d7daa Improved Responsiveness for auth pages 2024-05-19 14:52:42 +02:00
Moritz
769c876dc5 Added a way to sort the admin components with an index 2024-05-19 14:27:45 +02:00
Moritz
ccec79cca7 Added node online check on Server create 2024-05-19 00:04:27 +02:00
Moritz
e79f2199c3 Forgot two stars - readme.md 2024-05-18 23:52:09 +02:00
Moritz
c53d315bd8 Update README.md 2024-05-18 23:51:18 +02:00
Moritz
0ae9c27d93 Removed Last buggy thing
Forgot to remove it :(
2024-05-18 22:17:04 +02:00
Masu Baumgartner
2950034a30 Merge pull request #407 from Moonlight-Panel/v2_ImprovedAdminPage
Improved admin page with extendable columns and components via plugin system
2024-05-18 22:15:06 +02:00
Masu Baumgartner
158115bb3b Merge branch 'v2' into v2_ImprovedAdminPage 2024-05-18 22:14:05 +02:00
Moritz
56184a8254 Final admin Page
Added Admin System To be as Modular as masu wants it to be
2024-05-18 22:11:58 +02:00
Masu Baumgartner
c27b1689f3 Merge pull request #410 from Moonlight-Panel/v2_AdminPageLinkFix
Fixed Linking and Cards on Admin Page
2024-05-17 08:42:01 +02:00
Moritz
3c3dd2af92 Made issue template v2 ready
Removed Wings Issue field, edited placeholders for version
2024-05-16 16:26:09 +02:00
Moritz
125260e7ef Fixed Linking and Cards on Admin Page 2024-05-16 16:21:39 +02:00
Marcel Baumgartner
b608a0779c Quick-fix for server loading in user view 2024-05-14 21:57:08 +02:00
Moritz
7225db0bf1 added some informations 2024-05-14 14:52:27 +02:00
Masu Baumgartner
3f0cdff262 Merge pull request #408 from Moonlight-Panel/v2_FileManagerImprovements
Adding some more file manager improvements to the main branch
2024-05-14 14:50:10 +02:00
Moritz
3270039a6a improved admin page
Added the logic for a more modular admin page, where every feature can add cards and components with just a call of a function
2024-05-14 14:43:54 +02:00
Marcel Baumgartner
fda972a90e Implemented archiving and extracting for users 2024-05-14 14:08:07 +02:00
Masu Baumgartner
45e81c98bf Merge pull request #406 from Moonlight-Panel/v2_AddAdminPage
Added Basic Admin Page, will still be adding more in the future
2024-05-14 00:46:27 +02:00
Moritz
d9dd9bbf4d Optimized it, as Masu wished 2024-05-14 00:42:00 +02:00
Moritz
160de6443b Added Basic Admin Page, will still be adding more in the future 2024-05-13 18:38:52 +02:00
Masu Baumgartner
923a3c18b8 Started adding archive ui 2024-05-13 16:20:38 +02:00
Masu Baumgartner
8dc37525ce Improved egg importing so it should be able to import any egg now 2024-05-06 18:34:50 +02:00
Masu Baumgartner
7bd34842fa Commented out dummy value 2024-05-06 10:26:08 +02:00
Masu Baumgartner
da8b01bb98 Added server kill confirmation prompt. Improved power action handling 2024-05-06 10:24:45 +02:00
Masu Baumgartner
c9fe469f5b Merge pull request #404 from Moonlight-Panel/v2_FileManagerImprovements
Improved file manager. This is the first merge of this branch. More commits are planned
2024-05-06 09:45:54 +02:00
Masu Baumgartner
406f7cad65 Added empty file list indicator. Removed dropzone.js 2024-05-06 09:44:38 +02:00
Masu Baumgartner
558e237608 Small fix for node memory calculation
Made calculation accurate using:
https://stackoverflow.com/questions/41224738/how-to-calculate-system-memory-usage-from-proc-meminfo-like-htop
2024-05-06 09:15:27 +02:00
Marcel Baumgartner
b4251a0f1f Started with adding modules for archiving for the file manager 2024-05-04 23:06:15 +02:00
Marcel Baumgartner
0234a8e179 Increased kestrel default limits and added option to change the moonlight defaults 2024-05-01 20:17:41 +02:00
Masu Baumgartner
efacaa9b86 Merge pull request #402 from Moonlight-Panel/v2_addFaviconWithAssetApi
V2 add favicon with asset api
2024-04-30 09:04:24 +02:00
Moritz
7c40d999ff Image already existed so i used that one 2024-04-29 16:34:11 +02:00
Moritz
99c14693d5 Added Favicon using the asset api 2024-04-29 16:19:54 +02:00
Marcel Baumgartner
2cf03d4b68 Improved MySQL container boot handling
This will reduce the large error messages to a single line saying that the mysql container is still booting. Hopefully this fixes the login cli command as well
2024-04-29 16:16:25 +02:00
Masu Baumgartner
52bab229ea Add files via upload 2024-04-27 22:29:17 +02:00
Marcel Baumgartner
8b15383b45 Fixed percentage calculation of disk space 2024-04-27 22:05:03 +02:00
Marcel Baumgartner
eaddefdc8e Fixed node overview crash when no cores are available 2024-04-27 21:58:20 +02:00
Marcel Baumgartner
95cfa815fb Added some missing labels for the server manager ui 2024-04-27 17:35:24 +02:00
Marcel Baumgartner
870b2516a1 Fixed node list percentage calculation for storage 2024-04-27 17:03:45 +02:00
Masu Baumgartner
ef982a52ed Merge pull request #398 from Moonlight-Panel/v2_FixNodeLogsNullRef
Fixed the null reference exception when moonlight is unable to reach the node
2024-04-27 13:49:48 +02:00
Marcel Baumgartner
6ae2390b46 Fixed the null reference exception when moonlight is unable to reach the node 2024-04-27 13:49:15 +02:00
Masu Baumgartner
e1fbf601f3 Merge pull request #397 from Moonlight-Panel/v2_AddDetailsInNodeList
Added more details into the node list (like cpu, memory and disk)
2024-04-27 13:48:03 +02:00
Marcel Baumgartner
2364a53dd1 Added more details into the node list (like cpu, memory and disk) 2024-04-27 13:47:15 +02:00
Marcel Baumgartner
be7cecc721 Added github issue templates and funding.yml file
Thank you @gOOvER  for the templates. Just added them back in from the main branch
2024-04-26 19:08:14 +02:00
Masu Baumgartner
f2aad2ccdf Merge pull request #395 from Moonlight-Panel/v2_AddNodeLogView
Added node log view
2024-04-23 16:58:55 +02:00
Marcel Baumgartner
8e76a68b62 Added node log view 2024-04-23 16:58:11 +02:00
Masu Baumgartner
6c722a9ac3 Merge pull request #394 from Moonlight-Panel/v2_AddFooterCustomisation
Added footer customization
2024-04-23 16:26:50 +02:00
Marcel Baumgartner
52515e7df1 Added footer customization 2024-04-23 16:26:26 +02:00
Masu Baumgartner
722c56271f Merge pull request #393 from Moonlight-Panel/v2_SmallUiImprovements
Small ui improvements
2024-04-23 16:04:36 +02:00
Marcel Baumgartner
9e85c35f59 Upgraded to mooncoreui 1.1.6 2024-04-23 16:03:51 +02:00
Marcel Baumgartner
538a15b609 Added new mooncore form attributes for creating servers 2024-04-23 16:03:35 +02:00
Marcel Baumgartner
bb0ab9dc67 Added missing space for tooltip in the settings 2024-04-23 16:03:03 +02:00
Marcel Baumgartner
87b9b5e1c2 Fixed mobile layout for permission integer input 2024-04-23 16:02:43 +02:00
Masu Baumgartner
ba0b46db90 Merge pull request #392 from theghostofakatsuki/v2_AddNodeFqdnValidation
Added validation for the fqdn field of the node
2024-04-23 14:06:44 +02:00
theghostofakatsuki
ddcbf56abe Added validation for the fqdn field of the node 2024-04-23 14:03:35 +02:00
Masu Baumgartner
c553f6f5da Merge pull request #390 from Moonlight-Panel/v2_AddRegisterDeny
Added the option to disable register
2024-04-22 18:23:48 +02:00
Marcel Baumgartner
5b25774851 Added the option to disable register 2024-04-22 18:23:09 +02:00
Marcel Baumgartner
01729b982d Improved console disposing and closing 2024-04-17 17:03:18 +02:00
Masu Baumgartner
fd01787dfb Merge pull request #388 from Moonlight-Panel/v2_ImproveConsoleStreaming
Improved console streaming
2024-04-17 15:43:32 +02:00
Marcel Baumgartner
90eed5c74c Fixed a bug. Improved error handling. Small cleanup of code 2024-04-17 15:42:51 +02:00
Marcel Baumgartner
dcfb836b39 Added some documentation
it triggered me that this was missing, okay?
2024-04-17 15:42:23 +02:00
Marcel Baumgartner
610501ef19 Improved console ui disposing 2024-04-17 07:49:48 +02:00
Marcel Baumgartner
48e2e1eb98 Fixed weird console restore glitch 2024-04-17 07:31:56 +02:00
Marcel Baumgartner
f3ad71e33f Switched to improved mooncore advanced websocket stream version 2024-04-16 22:56:42 +02:00
Marcel Baumgartner
eaacdb3446 Fixed memory calculation of moonlight itself 2024-04-16 17:18:40 +02:00
Marcel Baumgartner
be173e1d48 Working on improved console streaming 2024-04-16 07:40:48 +02:00
Marcel Baumgartner
e3f040c978 Added the ability to send commands using the Enter key and not clicking the button
Was about time lol
2024-04-15 18:40:53 +02:00
Marcel Baumgartner
e25b005643 Upgraded to MoonCoreUI 1.1.5. Added allocations needed field for images 2024-04-15 17:39:23 +02:00
Masu Baumgartner
4631e66dca Merge pull request #387 from Moonlight-Panel/v2_FixImageDelete
Fixed image deletion
2024-04-14 11:58:08 +02:00
Marcel Baumgartner
73b93f8262 Fixed image deletion 2024-04-14 11:56:04 +02:00
Masu Baumgartner
5a1ecebbe9 Merge pull request #384 from gOOvER/name-lengh
Updated all user name length attributes in form models
2024-04-13 00:39:17 +02:00
gOOvER
8dbf458ea3 lot more placews for the Username lengh 2024-04-12 15:13:49 +02:00
Masu Baumgartner
c5fef04d06 Merge pull request #382 from gOOvER/goover
Change username length to 6
2024-04-12 10:42:55 +02:00
Marcel Baumgartner
5fb507febc Handle node booting state in the server console websocket 2024-04-12 10:41:54 +02:00
gOOvER
50d6954829 change username leght to 6 2024-04-12 08:20:44 +02:00
Marcel Baumgartner
e5f4fd9d62 Added auth header for console streaming 2024-04-11 13:07:27 +02:00
Masu Baumgartner
7da87fb065 Merge pull request #380 from Moonlight-Panel/v2_EarlyAccessFixes
Fixed bugs reported by early access people
2024-04-11 08:46:05 +02:00
Marcel Baumgartner
b81646c1d4 Fixed crash when deleting images 2024-04-11 08:41:43 +02:00
Marcel Baumgartner
752f84127c Changed lets encrypt email. Formatted command better 2024-04-10 22:30:43 +02:00
Marcel Baumgartner
bf1b9533c8 Updated node setup url 2024-04-10 12:29:47 +02:00
Masu Baumgartner
feddea1a69 Merge pull request #374 from Moonlight-Panel/v2_FinalizeFileManager
Finalized file manager
2024-04-01 20:32:42 +02:00
Marcel Baumgartner
20fcd5015e Improved file manager, switched to faster node/daemon file communication. Removed old components 2024-04-01 17:04:38 +02:00
Marcel Baumgartner
9abf32b288 Added select folder dialog. Added item moving as a module 2024-03-30 23:47:59 +01:00
Marcel Baumgartner
5d9c32a196 Added file editor to the api. Made the entire file manager available to the interfaces. 2024-03-30 22:39:28 +01:00
Marcel Baumgartner
cdc2954d0b Implemented modular create actions 2024-03-30 22:26:52 +01:00
Marcel Baumgartner
b2929fe211 Added modular selection actions 2024-03-30 22:06:33 +01:00
Marcel Baumgartner
3a74f3abcd Fixed small mistake on native ssl support 2024-03-30 00:21:33 +01:00
Marcel Baumgartner
49077e7023 Reimplemented the file manager with a cleaner ui, a base path protection from the core and modular and expandable 2024-03-30 00:18:40 +01:00
Marcel Baumgartner
44b2d07fdb Moved logo assets to the core asset folder. Removed unused default avatar 2024-03-24 21:16:21 +01:00
Marcel Baumgartner
0ee4f3fe04 Replaced io usage with network usage in stats page 2024-03-24 21:09:54 +01:00
Marcel Baumgartner
456d87f262 Added http debug middleware to trace requests 2024-03-24 19:20:13 +01:00
Marcel Baumgartner
e47a4c29f7 Switched to mooncore log rotation. Added experimental https support 2024-03-24 12:48:50 +01:00
Marcel Baumgartner
f172d765e3 Started adding node setup page 2024-03-22 20:50:11 +01:00
Marcel Baumgartner
9bf129f1ad Added automatic user creation on first start 2024-03-19 17:31:15 +01:00
Marcel Baumgartner
1cb603a3f3 Added default assets to docker image 2024-03-19 17:30:58 +01:00
Marcel Baumgartner
0a807605ad New v2 project structure 2024-03-18 09:31:33 +01:00
Marcel Baumgartner
e20415a5bd New gitignore 2024-03-18 09:31:13 +01:00
Marcel Baumgartner
15a3789174 Remove old v2 structure 2024-03-18 09:30:30 +01:00
Masu Baumgartner
823970f617 Merge pull request #372 from Moonlight-Panel/v2_ServerFeature
V2 server feature
2024-03-18 09:27:23 +01:00
Masu Baumgartner
5a025eb75b Create README.md 2024-03-04 11:17:17 +01:00
Marcel Baumgartner
bf6641c151 Reimplemented config in diagnose file and added node data 2024-02-14 12:07:14 +01:00
Marcel Baumgartner
f18877f9b1 Small ui fix 2024-02-14 11:46:05 +01:00
Marcel Baumgartner
c3679afed7 Fixed debug log config 2024-02-14 10:34:05 +01:00
Marcel Baumgartner
a0ca9af5c9 Started implementing schedules feature 2024-02-14 10:20:04 +01:00
Marcel Baumgartner
d1f73e6d78 Added reconnecting animation instead of connection lost icon for connection indicator 2024-02-13 22:56:18 +01:00
Marcel Baumgartner
368886c95c Removed console border 2024-02-13 22:52:46 +01:00
Marcel Baumgartner
86f3957028 Adjusted some font styles for server view 2024-02-13 22:50:37 +01:00
Marcel Baumgartner
6ec86fdc25 Improved ux for ticket popup 2024-02-13 22:46:31 +01:00
Marcel Baumgartner
068858f3a1 Added spacing to server user layout navbar 2024-02-13 22:33:06 +01:00
Marcel Baumgartner
8d11d2360e Redesigned network tab 2024-02-13 22:32:49 +01:00
Marcel Baumgartner
970bca7121 Fixed input alignment for variable page 2024-02-11 17:57:16 +01:00
Marcel Baumgartner
07c09e48e3 Started adding network tab for servers 2024-02-11 17:54:15 +01:00
Marcel Baumgartner
b2c816cafb Added console page as default page 2024-02-11 16:41:20 +01:00
Marcel Baumgartner
960a0bceff Reduced server console initial content 2024-02-11 16:38:51 +01:00
Marcel Baumgartner
aaf4c05630 Fixed moving items to the location they are currently at 2024-02-11 16:38:28 +01:00
Marcel Baumgartner
fada1a11b0 Added docker image select / variable editor page 2024-02-07 22:30:51 +01:00
Marcel Baumgartner
dfa34a6808 Fixed variable loading for single server query 2024-02-07 22:30:10 +01:00
Marcel Baumgartner
1b427607d1 Fixed jwt validation error. Added node allocations editor. Small fixes 2024-02-07 21:08:37 +01:00
Marcel Baumgartner
70445069fd Fixed docker build and ensured a storage folder is created to mount to volume to 2024-02-07 21:07:38 +01:00
Marcel Baumgartner
423616b9f3 Implemented download in the file manager. Made file access jwt more modular 2024-02-06 22:23:47 +01:00
Marcel Baumgartner
26ed50c94b Refactored and cleaned some stuff 2024-02-06 19:30:30 +01:00
Marcel Baumgartner
caa34dd79d Reimplemented filemanager and fixed some bugs 2024-02-06 11:12:04 +01:00
Marcel Baumgartner
0eabe27196 Reimplementing file manager and code editor (untested)
TODO: Add ftp auth back
2024-02-05 22:40:15 +01:00
Marcel Baumgartner
dfc2b5af17 Added hotkey service. Modified jwt service to use jwt types 2024-02-05 22:39:09 +01:00
Marcel Baumgartner
955946d0a6 Implemented console. Fixed streaming bugs. Added server command sending. Added reset and router back 2024-02-03 12:18:06 +01:00
Marcel Baumgartner
9e515d9ed7 Added state streaming. Started working on server console 2024-02-02 22:21:31 +01:00
Marcel Baumgartner
95507fd41f Added database migration checking and fixed/mocked server layout 2024-02-01 22:43:43 +01:00
Marcel Baumgartner
8d75b30ae4 Finished switching to mooncore 2024-02-01 17:56:05 +01:00
Marcel Baumgartner
64bcfe74e7 Refactored whole solution to use the MoonCore and MoonCoreUI library 2024-02-01 14:57:10 +01:00
Marcel Baumgartner
2729564495 Moved service admin pages to correct folder 2024-01-31 12:13:57 +01:00
Marcel Baumgartner
0ec6949095 Started updating service feature with missing changes from AddServersFeature branch 2024-01-30 22:56:26 +01:00
Marcel Baumgartner
681403ec6e Fixed some bugs and added a error handler for the service creation 2024-01-30 22:42:07 +01:00
Marcel Baumgartner
aaee81e9c4 Improved image editor and added more options 2024-01-29 17:17:42 +01:00
Marcel Baumgartner
4e5124cc1b Added image update pages. Added forms models. Implemented parts of the image editor components 2024-01-28 17:50:20 +01:00
Marcel Baumgartner
99a7d7bd73 Started implementing image editor and parse config editor 2024-01-28 13:58:23 +01:00
Marcel Baumgartner
6fd1336f1c Added base models for servers. Added ws packet connection utility. Added some ui from old branch. Added some packeges. And more smaller things 2024-01-27 13:28:09 +01:00
Marcel Baumgartner
33c1ffa0ba Started reimplementing server feature because we use a new project structure now. This is way cleaner than the last implementation 2024-01-26 20:09:53 +01:00
Marcel Baumgartner
19001e5836 Merge pull request #362 from Moonlight-Panel/v2_RestructureTry2
Restructured whole v2 project to be easier to develop new features
2024-01-26 17:02:30 +01:00
Marcel Baumgartner
12bc66a95b Restructured the rest of the features to their own environment 2024-01-26 13:53:34 +01:00
Marcel Baumgartner
63b2b40227 After the first try literally gave me a head ace, there is the second try with a better way of structuring it and not divinding so much core components in individual features. Still not done though 2024-01-25 21:40:23 +01:00
Marcel Baumgartner
bb53f1c40a Merge pull request #359 from Moonlight-Panel/v2_TransactionImprovement
Implemented transaction dates
2024-01-19 10:34:33 +01:00
Marcel Baumgartner
46f08059d7 Implemented transaction dates 2024-01-19 10:34:01 +01:00
Marcel Baumgartner
a9af1ec15e Merge pull request #358 from Moonlight-Panel/v2_UiFixes
Added some ui fixes
2024-01-16 16:32:14 +01:00
Marcel Baumgartner
9179d6825c Improved order duration border effect 2024-01-16 16:30:44 +01:00
Marcel Baumgartner
4816befa71 Improved ticket popup button. Added better separation between tickets in the user view 2024-01-16 16:25:34 +01:00
Marcel Baumgartner
67c846ddc8 Renamed announcements to news in community navigation 2024-01-16 16:18:38 +01:00
Marcel Baumgartner
79d860351c Resized profile picture change text in user settings 2024-01-16 16:15:09 +01:00
Marcel Baumgartner
c1216ea708 Improved 2fa and password ui 2024-01-16 16:12:36 +01:00
Marcel Baumgartner
a11569a737 Fixed inconsistent spacing. Reduced page size for transactions 2024-01-16 16:03:52 +01:00
Marcel Baumgartner
cd4feec58f Made space for more diagnose components 2024-01-16 16:02:01 +01:00
Marcel Baumgartner
518ec7055a Removed inconsistent border in settings/configuration page 2024-01-16 15:57:39 +01:00
Marcel Baumgartner
2552b92e5d Improved user dashboard 2024-01-16 15:38:28 +01:00
Marcel Baumgartner
e9d3ab5307 Added error reporting in soft error handler 2024-01-16 15:02:15 +01:00
Marcel Baumgartner
becc67c46b Improved error message view of soft error handler 2024-01-16 14:59:44 +01:00
Marcel Baumgartner
c3a0833410 Improved error view of smart form 2024-01-16 14:56:10 +01:00
Marcel Baumgartner
da53a0eef7 Merge pull request #357 from Moonlight-Panel/v2_AddEnvironmentConfiguration
Implemented environment variable loading in config service
2024-01-16 14:39:14 +01:00
Marcel Baumgartner
289f8921ff Implemented environment variable loading in config service 2024-01-16 14:38:43 +01:00
Marcel Baumgartner
e1a0cfeebb Merge branch 'v2' of https://github.com/Moonlight-Panel/Moonlight into v2 2024-01-08 08:43:29 +01:00
Marcel Baumgartner
55a7d71c7f Improved error message for username regex on register form 2024-01-08 08:43:11 +01:00
Marcel Baumgartner
8d1cb47a8a Merge pull request #353 from Moonlight-Panel/v2_ImproveTicketing
Improved ticketing
2024-01-08 08:34:39 +01:00
Marcel Baumgartner
2510d6748c Implemented viewing of closed tickets for users 2024-01-08 08:32:57 +01:00
Marcel Baumgartner
f17ff9246d Implemented input disable on closed tickets for users 2024-01-08 08:32:39 +01:00
Marcel Baumgartner
a2a9a6e21d Merge pull request #352 from Moonlight-Panel/v2_AntiAdBlocker
Implemented basic adblocker prevention
2024-01-05 11:44:18 +01:00
Marcel Baumgartner
0e1ddfbccb Implemented basic adblocker prevention
Tested with uBlockOrigin
2024-01-05 11:43:37 +01:00
Marcel Baumgartner
2edf8b4a9f Merge pull request #351 from Moonlight-Panel/v2_Fixes
Some fixes
2024-01-05 11:06:10 +01:00
Marcel Baumgartner
e47cac71fc Added a proper error message when starting a charge process without selecting a payment gateway 2024-01-05 11:05:35 +01:00
Marcel Baumgartner
0aa28d9764 Fixed service renewal check to allow admins to access the service even if it is expired 2024-01-05 11:04:43 +01:00
Marcel Baumgartner
8b032462c0 Merge pull request #350 from Moonlight-Panel/v2_AddDiagnoseFileExport
Added diagnose file export
2024-01-04 16:04:28 +01:00
Marcel Baumgartner
3ae694a3da Added diagnose file export 2024-01-04 16:03:55 +01:00
Marcel Baumgartner
741d13b18a Changed invalid img sources 2023-12-22 23:09:58 +01:00
Marcel Baumgartner
0d8cc5bd5d Merge pull request #345 from Moonlight-Panel/v2_AddThemeFeature
Added theme feature
2023-12-22 23:03:29 +01:00
Marcel Baumgartner
04ef9dc827 Added asset proxy. Adding google fonts as file instead of loading it externally. Removed demo theme 2023-12-22 23:02:37 +01:00
Marcel Baumgartner
c11ff632d2 Implemented theme exporting and importing 2023-12-22 20:47:00 +01:00
Marcel Baumgartner
c5a3c0550c As the default theme is not shown in the Themes page, we do not need this way of checking if its enabled 2023-12-22 14:38:08 +01:00
Marcel Baumgartner
a67829035e Implemented basic theme feature. Missing are import, export and asset proxy 2023-12-22 14:27:37 +01:00
Marcel Baumgartner
f57aac4f6c Made some ui changes 2023-11-18 23:25:52 +01:00
Marcel Baumgartner
3a53fa0a3c Done some todo's and removed old TL tags 2023-11-16 00:48:06 +01:00
Marcel Baumgartner
7145890801 Merge pull request #338 from Moonlight-Panel/AddServiceImplementationApi
Added service implementation api and some service utils
2023-11-15 21:06:02 +01:00
Marcel Baumgartner
6d5a5fd16c Added expired services overview to store pages 2023-11-15 21:02:35 +01:00
Baumgartner Marcel
3092daaad4 Fixed cookie loading. Started implementing service expire handling 2023-11-15 15:24:27 +01:00
Baumgartner Marcel
0f989a38c3 Implemented service admin view 2023-11-15 11:05:12 +01:00
Baumgartner Marcel
e8706cad1c Made implementation api cleaner 2023-11-15 10:25:28 +01:00
Baumgartner Marcel
d55490dd51 Started working on service implementation api 2023-11-14 17:54:15 +01:00
Marcel Baumgartner
a1cd6b5cd9 Merge pull request #337 from Moonlight-Panel/AddTicketSystem
Added ticket system
2023-11-10 15:14:49 +01:00
Marcel Baumgartner
0e43278bdd Merge branch 'v2' into AddTicketSystem 2023-11-10 15:13:51 +01:00
Marcel Baumgartner
d8bb2b7356 Implemented bucket delete and improved avatar update 2023-11-10 15:10:09 +01:00
Marcel Baumgartner
f779e5e920 Added logo and favicon 2023-11-09 21:47:11 +01:00
Marcel Baumgartner
c57ad9cce7 Fixed ui bugs. Implemented ticket deletion when a user is going to be deleted 2023-11-09 14:42:41 +01:00
Marcel Baumgartner
b492d65efb Added details in ticket view. Renamed mail verify button 2023-11-09 14:09:23 +01:00
Marcel Baumgartner
332937f964 Started implementing admin ticket ui. Cleaned up some stuff 2023-11-09 01:56:14 +01:00
Marcel Baumgartner
f5501f77fe Implemented file upload and improved ui. Fixed file upload bug in ticket service 2023-11-06 17:41:24 +01:00
Marcel Baumgartner
30bfae96fd Merge pull request #336 from Moonlight-Panel/AddPanelRestart
Added basic restarting for instances running in docker
2023-11-06 16:36:30 +01:00
Marcel Baumgartner
d95d613a57 Added basic restarting for instances running in docker 2023-11-06 16:34:52 +01:00
Marcel Baumgartner
1c96f9d13c Started implementing the ticket system. Implemented user site tickets without attachments atm. Added db models 2023-11-01 17:35:12 +01:00
Marcel Baumgartner
9e182768f6 Merge pull request #333 from Moonlight-Panel/AddConfigEditor
Added config editor
2023-10-31 10:48:53 +01:00
Baumgartner Marcel
11dace2617 Implemented config editor. Fixed auto property 2023-10-31 10:48:20 +01:00
Marcel Baumgartner
93cfe7cd1a Started on implementing a better reflection based editor 2023-10-30 00:40:59 +01:00
Marcel Baumgartner
b580781618 Merge pull request #332 from Moonlight-Panel/ImproveUserDelete
Improved user delete
2023-10-29 17:52:12 +01:00
Marcel Baumgartner
ee9190447f Fixed some user deletion issues 2023-10-29 17:51:47 +01:00
Marcel Baumgartner
aa501244e1 Improved user delete to delete relational data and remove all content from a user 2023-10-29 16:42:02 +01:00
Marcel Baumgartner
52d39151da Merge pull request #331 from Moonlight-Panel/AddUserAdmin
Added user view/edit. Added some tool tips. Improved some ui
2023-10-29 16:07:14 +01:00
Marcel Baumgartner
0241be13cf Added user view/edit. Added some tool tips. Improved some ui 2023-10-29 16:05:29 +01:00
Marcel Baumgartner
c3acb4898e Merge pull request #330 from Moonlight-Panel/AddCommunity
Added community tab
2023-10-29 11:15:05 +01:00
Marcel Baumgartner
559a00c181 Added sorting by creation date 2023-10-29 11:14:00 +01:00
Marcel Baumgartner
122a205f92 Fixed some bugs. Added admin ui. Added word filter 2023-10-29 00:49:15 +02:00
Marcel Baumgartner
c4e7e10f5e Added events and projects. Finished the basic community features 2023-10-28 22:27:25 +02:00
Marcel Baumgartner
6d83c31f42 Implemented update and delete for posts 2023-10-28 19:33:59 +02:00
Baumgartner Marcel
d98e8ef0f8 Added test logo file. Started adding community posts and comments 2023-10-27 15:10:44 +02:00
Baumgartner Marcel
a29dc8257e Implemented text editor 2023-10-27 09:05:45 +02:00
Marcel Baumgartner
801c78bb84 Started implementing text editor 2023-10-27 07:34:25 +02:00
Marcel Baumgartner
a671e601c0 Merge pull request #329 from Moonlight-Panel/AddStore
Implemented new store system
2023-10-26 10:13:29 +02:00
Baumgartner Marcel
4de6804f13 Added transaction event and mail sending for the transaction 2023-10-26 09:45:54 +02:00
Marcel Baumgartner
7a3d61c659 FInished auto crud. Switched to auto crud for coupons. Added gift code manage 2023-10-25 22:22:32 +02:00
Baumgartner Marcel
b0d9837256 Added auto form stuff and started implementing auto crud and store admin things 2023-10-25 16:26:42 +02:00
Marcel Baumgartner
f07e3c5a5a Started working on store admin 2023-10-24 23:45:00 +02:00
Marcel Baumgartner
19b5c7816a Small changes 2023-10-24 21:42:47 +02:00
Marcel Baumgartner
dae09668b2 Started on implementing mail sending for store system 2023-10-24 16:16:45 +02:00
Marcel Baumgartner
aa150a7a69 Extended plugin system to support kestrel pipeline injection 2023-10-24 12:26:29 +02:00
Marcel Baumgartner
d0f03a19a2 Add gift code redeem 2023-10-24 11:13:06 +02:00
Baumgartner Marcel
863a002370 Started implementing modular payment gateways. Implemented a basic plugin system
TODO: Add capability for plugins to modify the kestrel pipeline
2023-10-23 17:04:36 +02:00
Baumgartner Marcel
ff9bcc6433 Add payments page with transaction history 2023-10-23 15:04:57 +02:00
Baumgartner Marcel
e062df4eb6 Fixed some bugs. Added renew 2023-10-23 13:27:49 +02:00
Marcel Baumgartner
2dd1d1f69c Added coupon processing. Fixed price calculation 2023-10-22 22:02:45 +02:00
Marcel Baumgartner
3d4f22f6f6 Refactored some forms. Added service shares 2023-10-22 21:28:15 +02:00
Marcel Baumgartner
48c95d4ec6 Added service ordering and implemented basic service creation 2023-10-19 11:35:14 +02:00
Marcel Baumgartner
b19208b3b0 Add payment link to profile menu 2023-10-19 00:41:00 +02:00
Marcel Baumgartner
6410846afc Implemented order ui and validation. Added coupon handling 2023-10-19 00:30:54 +02:00
Marcel Baumgartner
f7a16fd287 Implemented basic store and store admin system. Added alerts. Added db models for store 2023-10-18 21:09:14 +02:00
Marcel Baumgartner
4159170244 Added ticket models. Did some ui 2023-10-17 09:00:59 +02:00
Marcel Baumgartner
8c82631569 Implemented live chat ui 2023-10-16 23:09:24 +02:00
Marcel Baumgartner
96bd131807 Implemented permissions. Added user overview and session overview. Added lazy loader.. Did some ui 2023-10-16 21:15:04 +02:00
Marcel Baumgartner
0cde0fe302 Added mail system. Added password reset and email verify. Switched to new event system. Added event based mail sending 2023-10-16 17:13:15 +02:00
Marcel Baumgartner
49c893f515 Implemented basic user auth, register, login, details and avatar stuff from helio 2023-10-15 19:19:47 +02:00
Marcel Baumgartner
3bb4e7daab Added event system, soft error handler and added some things from helio 2023-10-13 21:42:12 +02:00
Marcel Baumgartner
afb3a7f3a3 Added some helpers, a new logger and log migration and modified the router 2023-10-13 21:08:56 +02:00
Marcel Baumgartner
69b50275cd Added theme and basic ui defaults 2023-10-13 20:48:36 +02:00
Marcel Baumgartner
76866fe14f Update .gitignore 2023-10-13 11:29:29 +02:00
Marcel Baumgartner
3308def6c5 Update .gitignore 2023-10-13 11:23:29 +02:00
Marcel Baumgartner
39b632d483 Removed old project structure 2023-10-13 11:06:16 +02:00
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
Marcel Baumgartner
388deacf60 Merge pull request #250 from Moonlight-Panel/ImproveInstallUX
Improved install user experience
2023-08-08 00:54:10 +02:00
Marcel Baumgartner
aa547038de Improved install user experience 2023-08-08 00:53:00 +02:00
Dannyx
78bfd68d63 Update README.md because of New installer 2023-08-07 22:23:20 +02:00
Marcel Baumgartner
17e3345b8a Added date formatter for user overview 2023-08-06 22:00:59 +02:00
Marcel Baumgartner
f95312c1e3 Merge pull request #248 from Moonlight-Panel/AddTicketSystem
Added ticket system
2023-08-06 21:57:24 +02:00
Marcel Baumgartner
2144ca3823 Added byte converter and fixed memory view at the nodes 2023-08-06 21:55:23 +02:00
Marcel Baumgartner
de45ff40d8 Implemented a basic ticket system 2023-08-04 14:00:25 +02:00
Marcel Baumgartner
606085c012 Merge pull request #242 from Moonlight-Panel/AddNewBackupFormat
Added new backup format
2023-08-02 22:05:39 +02:00
Marcel Baumgartner
00525d8099 Added new backup format 2023-08-02 22:05:07 +02:00
Marcel Baumgartner
26617d67f5 Merge pull request #241 from Moonlight-Panel/SmallFixes
Did some small fixes, added connection timeout check, improved ux
2023-08-02 03:07:47 +02:00
Marcel Baumgartner
600bec3417 Did some small fixes, added connection timeout check, improved ux 2023-08-02 03:06:54 +02:00
Marcel Baumgartner
4e85d1755a Merge pull request #240 from DatGamet/patch-1
Update de_de.lang
2023-08-02 01:39:58 +02:00
DatGamet
0832936933 Update de_de.lang 2023-08-02 01:39:08 +02:00
Marcel Baumgartner
ecda2ec6d1 Merge pull request #239 from Moonlight-Panel/FixPluginSystem
Fixed plugin loading system
2023-08-01 22:21:54 +02:00
Marcel Baumgartner
6f3765a3bf Fixed plugin loading system 2023-08-01 22:21:19 +02:00
Marcel Baumgartner
29002d3445 Update Moonlight.csproj 2023-08-01 20:38:22 +02:00
Marcel Baumgartner
6d0456a008 Merge pull request #238 from Moonlight-Panel/AddDdosProtection
Added new ddos protection
2023-07-24 00:33:22 +02:00
Marcel Baumgartner
3e698123bb Merge branch 'main' into AddDdosProtection 2023-07-24 00:33:01 +02:00
Marcel Baumgartner
f3fb86819a Merge pull request #237 from Moonlight-Panel/FixDomainIdentityIssues
Fixed domain identity issues
2023-07-24 00:30:50 +02:00
Marcel Baumgartner
e2248a8444 Fixed domain identity issues 2023-07-24 00:30:18 +02:00
Marcel Baumgartner
2cf2b77090 Added new ddos protection 2023-07-24 00:23:29 +02:00
Marcel Baumgartner
fedc9278d4 Updated dependencies 2023-07-23 22:12:17 +02:00
Marcel Baumgartner
f29206a69b Merge pull request #236 from Moonlight-Panel/AddPluginSystem
Add plugin system
2023-07-23 21:31:26 +02:00
Marcel Baumgartner
0658e55a78 Implemented basic plugin store and improved plugin system 2023-07-23 21:30:57 +02:00
Marcel Baumgartner
21bea974a9 Implemented a basic plugin system 2023-07-22 23:44:45 +02:00
Marcel Baumgartner
33ef09433e Merge pull request #235 from Moonlight-Panel/AddMinerCheck
Add basic miner check
2023-07-22 02:24:16 +02:00
Marcel Baumgartner
173bff67df Add basic miner check 2023-07-22 02:08:39 +02:00
Marcel Baumgartner
512a989609 Merge pull request #234 from Moonlight-Panel/FixDomainOwnerMatching
Fixed domain owner matching
2023-07-20 17:24:05 +02:00
Marcel Baumgartner
2d7dac5089 Fixed domain owner matching 2023-07-20 17:17:05 +02:00
Marcel Baumgartner
11708fbc3b Merge pull request #231 from Moonlight-Panel/AdditionalDnsErrorHandling
Added additional dns error handling
2023-07-20 02:00:41 +02:00
Marcel Baumgartner
daeb4dd5b9 Added additional dns error handling 2023-07-20 02:00:03 +02:00
Marcel Baumgartner
daba4cba04 Merge pull request #230 from Moonlight-Panel/AddSecurityLogs
Added security logs. Removed unsued log models. Added dynamic config load
2023-07-19 22:09:58 +02:00
Marcel Baumgartner
1cd0f0f96f Added security logs. Removed unsued log models. Added dynamisc config load system for development 2023-07-19 20:07:57 +02:00
Marcel Baumgartner
6a30db07a7 Merge pull request #229 from Moonlight-Panel/AddPermissionSystem
Added permission system and improved UIs and the IdentityService
2023-07-18 02:02:31 +02:00
Marcel Baumgartner
6c8754d008 Removed moved navigation items 2023-07-18 02:01:02 +02:00
Marcel Baumgartner
356ba94592 Implemented new user editing including permission groups 2023-07-18 01:57:48 +02:00
Marcel Baumgartner
d3b55d155b Added permission groups. Cleaned security ui. Added some permission stuff 2023-07-17 22:16:39 +02:00
Marcel Baumgartner
0015001d7c Fixed some permissions. Cleaned some UIs 2023-07-17 16:22:22 +02:00
Marcel Baumgartner
0a86aa8aa4 Implemented new permission and identity system 2023-07-17 00:48:27 +02:00
Marcel Baumgartner
74d4ee729d Adding permissions. I hate my life ;) 2023-07-16 22:44:36 +02:00
Marcel Baumgartner
178ff36e86 Implemented a basic permission system base 2023-07-16 02:21:53 +02:00
Marcel Baumgartner
f852df5807 Merge pull request #227 from Moonlight-Panel/StripeIntegration
Implemented a basic stripe integration
2023-07-13 21:36:57 +02:00
Marcel Baumgartner
90f4b04857 Changed configuration file 2023-07-13 21:36:19 +02:00
Marcel Baumgartner
244e87ed18 Implemented a basic stripe interation 2023-07-13 21:29:20 +02:00
Marcel Baumgartner
80ea5a543f Merge pull request #226 from Moonlight-Panel/main
Update branch StripeIntegration with latest commits
2023-07-13 20:46:39 +02:00
Marcel Baumgartner
5baba05f5f Merge pull request #225 from Moonlight-Panel/NewMailSystem
Added new mail system
2023-07-13 20:40:43 +02:00
Marcel Baumgartner
591da6de5c Implemented new mail system components 2023-07-13 20:39:02 +02:00
Marcel Baumgartner
c1ddff4ae3 Update .gitattributes 2023-07-13 17:33:34 +02:00
Marcel Baumgartner
67d78d7104 Merge pull request #224 from Moonlight-Panel/FixGravatarBug
Fixed gravatar bug
2023-07-13 17:26:09 +02:00
Marcel Baumgartner
52f4b00f84 Fixed gravatar bug 2023-07-13 17:25:48 +02:00
Marcel Baumgartner
8f028e2ac6 Update .gitattributes 2023-07-13 17:21:22 +02:00
Marcel Baumgartner
5bd6f15203 Added a mail template editor 2023-07-12 15:48:30 +02:00
Marcel Baumgartner
4c39ad6170 Removed legacy trash mail detector service 2023-07-12 14:34:26 +02:00
Marcel Baumgartner
12392d4f47 Merge pull request #223 from Moonlight-Panel/AddTempMailCheck
Added temp mail check
2023-07-12 14:22:41 +02:00
Marcel Baumgartner
b75147e4c0 Added temp mail check 2023-07-12 14:20:55 +02:00
Marcel Baumgartner
8f9508f30b Merge pull request #222 from Moonlight-Panel/FixServerList
Fixed server list and server navigation
2023-07-12 02:03:45 +02:00
Marcel Baumgartner
428e2668d3 Fixed server list and server navigation 2023-07-12 02:03:20 +02:00
Marcel Baumgartner
c1cfb35c86 Merge pull request #221 from Moonlight-Panel/FixDnsBug
Fixed dns bug
2023-07-12 01:29:43 +02:00
Marcel Baumgartner
d6777c463e Fixed dns bug 2023-07-12 01:29:23 +02:00
Marcel Baumgartner
f9126bffe0 Merge pull request #219 from Moonlight-Panel/AddEggImporter
Implemented pterodactyl egg import function
2023-07-10 22:01:29 +02:00
Marcel Baumgartner
0488e83a38 Implemented pterodactyl egg import function 2023-07-10 22:01:10 +02:00
Marcel Baumgartner
d87ddc90e3 Merge pull request #216 from Moonlight-Panel/UiEnhancements
Added some UI enhancements
2023-07-09 19:48:10 +02:00
Marcel Baumgartner
151bc82998 Added better server image seletor 2023-07-09 19:46:32 +02:00
Marcel Baumgartner
e4c21c74a5 Added custom scroll bar 2023-07-09 19:46:18 +02:00
Marcel Baumgartner
13741a2be9 Merge pull request #215 from Moonlight-Panel/EnhanceInstallConsole
Enhanced install console
2023-07-08 02:50:56 +02:00
Marcel Baumgartner
c866e89b72 Enhanced install console 2023-07-08 02:50:13 +02:00
Marcel Baumgartner
8be93bc53c Merge pull request #214 from Moonlight-Panel/FixSessionView
Fixed session view
2023-07-07 19:10:47 +02:00
Marcel Baumgartner
384b6a3e7d Fixed session view 2023-07-07 19:09:23 +02:00
Marcel Baumgartner
ba2de54c60 Update README.md 2023-07-07 19:01:08 +02:00
Marcel Baumgartner
bd5567e24f Merge pull request #213 from Moonlight-Panel/AddCloudflareEnableOption
Added cloudflare enable option
2023-07-07 18:22:35 +02:00
Marcel Baumgartner
b8e39824b5 Added cloudflare enable option 2023-07-07 18:22:18 +02:00
Marcel Baumgartner
d8c9bdbd8d Merge pull request #212 from Moonlight-Panel/AddLoginRegisterDeny
Add config option to prevent users from login and register
2023-07-07 18:11:45 +02:00
Marcel Baumgartner
80eb210af0 Add config option to prevent users from login and register 2023-07-07 18:09:38 +02:00
Marcel Baumgartner
a295354549 Merge pull request #210 from Dannyx1604/patch-1
I got bored again (de_de.lang)
2023-07-07 03:23:31 +02:00
Marcel Baumgartner
749ea5dc8e Merge pull request #211 from Moonlight-Panel/AddTelemetryReporter
Added telemetry reporter
2023-07-07 03:14:06 +02:00
Marcel Baumgartner
f52b9e2951 Added telemetry reporter 2023-07-07 03:06:16 +02:00
Dannyx
d2dbb68967 I got bored again (de_de.lang) 2023-07-06 23:28:08 +02:00
Marcel Baumgartner
d1c9009e9f Merge pull request #209 from Moonlight-Panel/NewVisualConfigEditor
Added a new visual config editor
2023-07-06 16:46:29 +02:00
Marcel Baumgartner
d024a834f9 Added a new visual config editor 2023-07-06 16:46:01 +02:00
Marcel Baumgartner
c0df8ac507 Implemented new subscription system and basic stripe support 2023-07-06 02:12:06 +02:00
Marcel Baumgartner
ab529991fd Fix some javascript not loaded issues
Because all js files are executed in the order they were put into the document some js files were not loaded while starting blazor. this should fix it (hopefully ;) )
2023-07-04 18:06:14 +02:00
Marcel Baumgartner
92705837ba Merge pull request #208 from Moonlight-Panel/RewriteSessionSystem
Rewritten session system to match new standarts and be more performant
2023-07-04 17:51:09 +02:00
Marcel Baumgartner
609d5451f9 Rewritten session system to match new standarts and be more performant 2023-07-04 17:49:27 +02:00
Marcel Baumgartner
2bb2caeeed Merge pull request #207 from Moonlight-Panel/AddIpLogs
Added ip log for register and last visit
2023-07-03 20:17:20 +02:00
Marcel Baumgartner
61db49bfb7 Added ip log for register and last visit 2023-07-03 20:01:34 +02:00
Marcel Baumgartner
a75678d305 Merge pull request #206 from Moonlight-Panel/SmallFixes
Small fixes
2023-07-02 21:33:12 +02:00
Marcel Baumgartner
d418c91efa Fixed js invoke errors 2023-07-02 21:30:34 +02:00
Marcel Baumgartner
7f2da5a55d Updated sweet alert 2 2023-07-02 20:56:10 +02:00
Marcel Baumgartner
5e592ccdcb Added ignore for unexpected dispose errors 2023-07-02 20:51:08 +02:00
Marcel Baumgartner
016f50fb1c Added ignore for json serialize errors 2023-07-02 20:48:47 +02:00
Marcel Baumgartner
fe21668a2b Removed wrong logged warn 2023-07-02 20:44:29 +02:00
Marcel Baumgartner
1aab86a317 Fixed wrong ssl config for nodes 2023-07-02 20:41:31 +02:00
Marcel Baumgartner
243d23d4e2 Fixed repatcha config for empty values 2023-07-02 20:40:47 +02:00
Marcel Baumgartner
2fe17473ae Merge pull request #204 from Moonlight-Panel/SwitchToNewConfigSystem
Switched to new config system
2023-07-02 02:19:32 +02:00
Marcel Baumgartner
609cf8cfac Switched to new config system 2023-07-02 02:16:44 +02:00
Marcel Baumgartner
678da30b09 Merge pull request #203 from Moonlight-Panel/LogsAndFixes
Added new log files and log migrators. Fixed some errors with js invokes
2023-07-02 00:21:55 +02:00
Marcel Baumgartner
d19412f4bb Added new log files and log migrators. Fixed some errors with js invokes 2023-07-02 00:21:35 +02:00
Marcel Baumgartner
1665d6e537 Merge pull request #202 from Moonlight-Panel/AddSentrySupport
Added new sentry support
2023-07-01 19:01:00 +02:00
Marcel Baumgartner
fd210f2404 Added new sentry support 2023-07-01 19:00:38 +02:00
Marcel Baumgartner
c33729fb44 Merge pull request #201 from Moonlight-Panel/FixServerList
Fixed server list
2023-06-30 21:55:58 +02:00
Marcel Baumgartner
7983bf3ee4 Fixed server list 2023-06-30 21:55:32 +02:00
Marcel Baumgartner
a09f60aea7 Merge pull request #200 from Moonlight-Panel/HttpTimeoutFixes
Fixed timeout options from assumed seconds to real value miliseconds
2023-06-29 23:28:07 +02:00
Marcel Baumgartner
28b5893c21 Fixed timeout options from assumed seconds to real value miliseconds 2023-06-29 23:27:48 +02:00
Marcel Baumgartner
25b47d8b6c Merge pull request #199 from Moonlight-Panel/AddNewGermanTranslation
Added new german translations
2023-06-29 23:10:21 +02:00
Marcel Baumgartner
85f5b8a7da Added new german translations 2023-06-29 23:09:58 +02:00
Marcel Baumgartner
ab9333f99a Merge pull request #198 from Moonlight-Panel/FixServerDelete
Fixed server delete
2023-06-26 22:51:17 +02:00
Marcel Baumgartner
d60f8fc905 Fixed server delete 2023-06-26 22:50:45 +02:00
Marcel Baumgartner
fe1f4412d8 Merge pull request #197 from Moonlight-Panel/AddedRetry
Added retry class and added it to some api calls that need it
2023-06-26 22:45:56 +02:00
Marcel Baumgartner
f191533410 Added retry class and added it to some api calls that need it 2023-06-26 22:45:33 +02:00
Marcel Baumgartner
a894707536 Merge pull request #196 from Moonlight-Panel/SmallBugFixes
Small bug fixes
2023-06-26 18:05:58 +02:00
Marcel Baumgartner
d2ccc84286 Fixed sidebar text sizing issues 2023-06-26 17:23:25 +02:00
Marcel Baumgartner
f2ec43f2d2 Fixed not enabled installing screen for new servers 2023-06-26 17:19:54 +02:00
Marcel Baumgartner
7feccc8d9f Fixed error loop for fileaccess providers not supporting the launch url 2023-06-26 17:19:32 +02:00
Marcel Baumgartner
a8bd1193ce Merge pull request #195 from Moonlight-Panel/SecurityPatches
Security patches
2023-06-26 00:10:03 +02:00
Marcel Baumgartner
366d1a9205 Merge pull request #194 from Moonlight-Panel/AddStreamerModeAndFixUI
Added streamer mode and fixed security settings ui
2023-06-26 00:07:23 +02:00
Marcel Baumgartner
df9ed95c6b Added streamer mode and fixed security settings ui 2023-06-26 00:06:44 +02:00
Marcel Baumgartner
23a211362e Merge pull request #193 from Moonlight-Panel/EnhanceFileManager
Enhanced winscp button and new file/folder menu
2023-06-25 17:32:57 +02:00
Marcel Baumgartner
cf91d44902 Enhanced winscp button and new file/folder menu 2023-06-25 17:31:36 +02:00
Marcel Baumgartner
35633e21a9 Merge pull request #192 from Moonlight-Panel/EnhanceServerListLayout
Enhanced server list
2023-06-25 00:01:53 +02:00
Marcel Baumgartner
ce8b8f6798 Enhanced server list 2023-06-25 00:01:28 +02:00
Marcel Baumgartner
c28c80ba25 Merge pull request #191 from Moonlight-Panel/FixDnsManager
Fixed dns loading issues. Added udp support
2023-06-24 23:45:49 +02:00
Marcel Baumgartner
da17b1df93 Fixed dns loading issues. Added udp support 2023-06-24 23:45:29 +02:00
Marcel Baumgartner
f9f5865ef9 Prevent user locking when duplicating the email entries 2023-06-24 22:35:38 +02:00
Marcel Baumgartner
389ded9b77 Fixed oauth2 account spoofing using unverified discord accounts for claiming identity 2023-06-24 22:15:04 +02:00
Marcel Baumgartner
faebaa59dd Merge pull request #189 from Moonlight-Panel/AddCustomLayoutServerList
Added custom layout options for the server list
2023-06-24 02:35:21 +02:00
Marcel Baumgartner
6b7dc2ad05 Added custom layout options for the server list 2023-06-24 02:35:01 +02:00
Marcel Baumgartner
e356c9d0c8 Update README.md 2023-06-23 05:06:12 +02:00
Marcel Baumgartner
efed2a6a5c Merge pull request #188 from Moonlight-Panel/ImproveLogging
Improved logging. Added better error handling for mysql database backup
2023-06-23 00:51:32 +02:00
Marcel Baumgartner
6f138c2c51 Improved logging. Added better error handling for mysql database backup 2023-06-23 00:51:09 +02:00
Marcel Baumgartner
6c43e6a533 Merge pull request #187 from Moonlight-Panel/AddMalwareScan
Added maleware scan
2023-06-22 20:36:58 +02:00
Marcel Baumgartner
0379afd831 Added maleware scan 2023-06-22 20:36:33 +02:00
Marcel Baumgartner
b8bfdb7729 Merge pull request #185 from Moonlight-Panel/SwitchToSerilog
Switched to serilog as logging system
2023-06-21 19:15:53 +02:00
Marcel Baumgartner
72f60ec97c Switched to serilog as logging system 2023-06-21 19:15:30 +02:00
Marcel Baumgartner
1b40250750 Revert "Merge branch 'DiscordBot' into main"
This reverts commit cdf2988cb6, reversing
changes made to 76415b4a0a.
2023-06-20 20:59:49 +02:00
Ole Sziedat
cdf2988cb6 Merge branch 'DiscordBot' into main 2023-06-20 20:52:46 +02:00
Marcel Baumgartner
76415b4a0a Merge pull request #182 from Moonlight-Panel/ImproveFileEditor
Added STRG+S support for editor and better saving
2023-06-20 20:38:17 +02:00
Marcel Baumgartner
52d00baf2b Added STRG+S support for editor and better saving 2023-06-20 20:37:57 +02:00
Marcel Baumgartner
cd41db510e Merge pull request #181 from Moonlight-Panel/AddServerAllocationEditor
Added a basic allocation editor for servers
2023-06-20 19:21:41 +02:00
Marcel Baumgartner
1afd4e8b92 Added a basic allocation editor for servers 2023-06-20 19:18:18 +02:00
Marcel Baumgartner
ef37088c7a Merge pull request #180 from Moonlight-Panel/ImproveUserInterface
Fixed ui bugs, improved plugins page, added new 404 component
2023-06-20 02:56:15 +02:00
Marcel Baumgartner
e71495533b Fixed ui bugs, improved plugins page, added new 404 component 2023-06-20 02:55:50 +02:00
Marcel Baumgartner
e2a6d70f6a Update README.md 2023-06-18 06:23:17 +02:00
Marcel Baumgartner
e95853b09c Update README.md 2023-06-18 03:25:23 +02:00
Marcel Baumgartner
0537ca115e Remove assets from github language statistics 2023-06-18 02:50:08 +02:00
Marcel Baumgartner
432e441972 Change moonlight service to always fetch the changelog 2023-06-18 02:37:07 +02:00
Marcel Baumgartner
1dae5150bd Merge pull request #178 from Moonlight-Panel/RewriteNotificationSystem
Rewrite notification system
2023-06-18 02:32:33 +02:00
Marcel Baumgartner
72c6f636ee Rewritten notification system 2023-06-17 20:47:07 +02:00
Daniel Balk
e54d04277d Merge pull request #177 from Moonlight-Panel/ShowMoonlightAppInSessions
added check for moonlight app for getting the device
2023-06-17 17:52:41 +02:00
Daniel Balk
f559f08e8d added check for moonlight app for getting the device 2023-06-17 17:51:34 +02:00
Daniel Balk
2674fb3fa7 Update Debugging.razor 2023-06-17 14:10:24 +02:00
Marcel Baumgartner
d5d77ae7da Merge pull request #175 from Moonlight-Panel/AddMoonlightSideDnsCheckSsl
Added moonlight side dns check for ssl
2023-06-17 13:39:25 +02:00
Marcel Baumgartner
3ae905038c Added moonlight side dns check for ssl 2023-06-17 13:38:32 +02:00
Marcel Baumgartner
6707d722e0 Merge pull request #174 from Moonlight-Panel/SomeHotfixes
Fixed cleanup, error handling missing and missing gif
2023-06-17 13:00:12 +02:00
Marcel Baumgartner
bc9fecf6d9 Fixed cleanup, error handling missing and missing gif 2023-06-17 12:57:01 +02:00
Marcel Baumgartner
c2cb10f069 Merge pull request #173 from Moonlight-Panel/CleanupHotfix
Fixed cleanup calculation errors
2023-06-17 00:30:16 +02:00
Marcel Baumgartner
cc06d1eb0b Fixed cleanup calculation errors 2023-06-17 00:29:47 +02:00
Marcel Baumgartner
916ff71022 Merge pull request #172 from Moonlight-Panel/FixConsoleIssues
Fixed xterm console issues
2023-06-16 22:57:04 +02:00
Marcel Baumgartner
9e80342e26 Fixed xterm console issues 2023-06-16 22:56:33 +02:00
Marcel Baumgartner
0fb97683bf Merge pull request #171 from Moonlight-Panel/DisableServerDelete
Disabled server delete
2023-06-16 20:30:00 +02:00
Marcel Baumgartner
32415bad54 Merge pull request #170 from Moonlight-Panel/AddModrinthSupport
Add modrinth support
2023-06-16 20:29:45 +02:00
Marcel Baumgartner
d2b0bcc4a3 Disabled server delete 2023-06-16 20:29:23 +02:00
Daniel Balk
2f4f4193d3 Merge pull request #169 from Moonlight-Panel/NotificationDebuggingUi
added simple debugging page
2023-06-16 20:25:39 +02:00
Daniel Balk
7279f05a16 added simple debugging page 2023-06-16 20:24:32 +02:00
Marcel Baumgartner
3962723acb Implemented plugin installer 2023-06-16 20:24:03 +02:00
Marcel Baumgartner
125e72fa58 Switched to new routing for the server manage page 2023-06-16 17:43:48 +02:00
Marcel Baumgartner
880cce060f Added missing server installing db change 2023-06-16 17:33:47 +02:00
Marcel Baumgartner
0e04942111 Merge pull request #168 from Moonlight-Panel/AddServerArchive
Added archive system. Added ml debug menu and related stuff
2023-06-16 17:21:05 +02:00
Marcel Baumgartner
46a88d4638 Added archive system. Added ml debug menu and related stuff 2023-06-16 16:58:58 +02:00
Marcel Baumgartner
c7c39fc511 Merge pull request #167 from Moonlight-Panel/RemoveUselessConsoleLogs
Removed useless console streaming logs
2023-06-13 22:41:46 +02:00
Marcel Baumgartner
3b9bdd1916 Removed useless console streaming logs 2023-06-13 22:35:03 +02:00
Marcel Baumgartner
d267be6d69 Merge pull request #166 from Moonlight-Panel/AddServerFetchBotApi
Added server fetch for single server in bot api
2023-06-13 21:51:20 +02:00
Marcel Baumgartner
18f6a1acdc Added server fetch for single server in bot api 2023-06-13 21:50:33 +02:00
Marcel Baumgartner
2ca41ff18f Merge pull request #165 from Moonlight-Panel/FixSessionListEmailFilter
Fixed session list email filter
2023-06-12 22:12:37 +02:00
Marcel Baumgartner
74c77bc744 Fixed session list email filter 2023-06-12 22:12:05 +02:00
Marcel Baumgartner
1ff8cdd7a9 Merge pull request #164 from Moonlight-Panel/RemovedUnnecessaryReload
Removed unnecessary reload
2023-06-12 00:47:42 +02:00
Marcel Baumgartner
bd320d025a Removed unnecessary reload 2023-06-12 00:47:00 +02:00
Marcel Baumgartner
9a5b004e17 Merge pull request #163 from Moonlight-Panel/AddUserWebsiteDelete
Added webspace delete
2023-06-12 00:10:27 +02:00
Marcel Baumgartner
3aee059860 Added webspace delete 2023-06-12 00:10:03 +02:00
Marcel Baumgartner
3dfa7f66de Merge pull request #162 from Moonlight-Panel/AddUserDomainDelete
Added user domain delete
2023-06-11 22:10:41 +02:00
Marcel Baumgartner
c2949b4773 Added user domain delete 2023-06-11 22:10:28 +02:00
Marcel Baumgartner
c2d0ab4b1b Merge pull request #161 from Moonlight-Panel/FixServerDelete
Fixed server delete
2023-06-11 21:58:56 +02:00
Marcel Baumgartner
de02f0bd74 Fixed server delete 2023-06-11 21:50:45 +02:00
Marcel Baumgartner
e280a95619 Merge pull request #160 from Moonlight-Panel/AddVersioningSystem
Removed old app version copy instruction
2023-06-11 21:11:39 +02:00
Marcel Baumgartner
6f06be9cc6 Removed old app version copy instruction 2023-06-11 21:11:09 +02:00
Marcel Baumgartner
08745a83b4 Merge pull request #159 from Moonlight-Panel/AddVersioningSystem
Add new version and changelog system
2023-06-11 21:06:24 +02:00
Marcel Baumgartner
9a262d1396 Add new version and changelog system 2023-06-11 20:59:20 +02:00
Marcel Baumgartner
0a1b93b8fb Merge pull request #158 from Moonlight-Panel/ImproveStatistics
Added better statistics calculation and active user messurement
2023-06-11 17:57:01 +02:00
Marcel Baumgartner
4b638fc5da Added better statistics calculation and active user messurement 2023-06-11 17:56:45 +02:00
Marcel Baumgartner
d8e34ae891 Merge pull request #157 from Moonlight-Panel/FixSftpWebsitePort
Fixed website sftp port
2023-06-11 16:32:48 +02:00
Marcel Baumgartner
311237e49d Fixed website sftp port 2023-06-11 16:32:28 +02:00
Marcel Baumgartner
6591bbc927 Merge pull request #156 from Moonlight-Panel/AddServerBackgroundImage
Add dynamic background images for servers
2023-06-11 16:28:03 +02:00
Marcel Baumgartner
43c5717d19 Added default background and optimized change methods 2023-06-11 16:26:43 +02:00
Marcel Baumgartner
61d547b2ce Add dynamic background images for servers 2023-06-10 00:00:54 +02:00
Marcel Baumgartner
d7fbe54225 Merge pull request #151 from Moonlight-Panel/AddUptimeCounter
Added uptime service
2023-06-09 15:02:14 +02:00
Marcel Baumgartner
d0004e9fff Added uptime service 2023-06-09 15:01:51 +02:00
Marcel Baumgartner
829596a3e7 Merge pull request #150 from Moonlight-Panel/AddHealthChecks
Add health checks
2023-06-09 14:39:23 +02:00
Marcel Baumgartner
fc319f0f73 Added better error handling and daemon health check 2023-06-09 14:38:30 +02:00
Marcel Baumgartner
bd8ba11410 Merge pull request #149 from Moonlight-Panel/main
Update AddHealthChecks with latest commits
2023-06-09 14:21:28 +02:00
Marcel Baumgartner
0c4fc942b0 Merge pull request #148 from Moonlight-Panel/AddNewDaemonCommunication
Add new daemon communication
2023-06-07 03:34:26 +02:00
Marcel Baumgartner
94b8f07d92 Did some testing. Now able to finish new daemon communication 2023-06-07 03:29:36 +02:00
Marcel Baumgartner
f11eef2734 Merge pull request #147 from Moonlight-Panel/main
Update AddNewDaemonCommunication with latest commits
2023-06-07 02:49:53 +02:00
Marcel Baumgartner
0f8946fe27 Switched to new daemon communication 2023-06-07 02:46:26 +02:00
Marcel Baumgartner
a8cb1392e8 Merge pull request #145 from Moonlight-Panel/ImproveUserExperienceJ2S
Improved user experience for enabling and disabling join2start
2023-06-07 02:39:00 +02:00
Marcel Baumgartner
4241debc3b Improved user experience for enabling and disabling join2start 2023-06-07 02:38:21 +02:00
Marcel Baumgartner
a99959bd2b Merge pull request #144 from Moonlight-Panel/AddDeployNodeOverride
Added smart deploy node override option
2023-06-07 02:23:56 +02:00
Marcel Baumgartner
23644eb93f Added smart deploy node override option 2023-06-07 02:23:30 +02:00
Marcel Baumgartner
f8fcb86ad8 Added base health check and diagnostic system 2023-06-06 22:50:33 +02:00
Marcel Baumgartner
ce0016fa3f Merge pull request #143 from Moonlight-Panel/AddFolderDownloadHandler
Added error handler for folder download
2023-06-05 22:01:40 +02:00
Marcel Baumgartner
15d8f49ce9 Added error handler for folder download 2023-06-05 22:01:21 +02:00
Marcel Baumgartner
98d8e5b755 Merge pull request #142 from Moonlight-Panel/ImproveCpuUsageCalculation
Improved cpu usage calculation
2023-06-05 21:48:15 +02:00
Marcel Baumgartner
bfa1a09aab Improved cpu usage calculation 2023-06-05 21:47:33 +02:00
Marcel Baumgartner
84396c34e6 Merge pull request #140 from Moonlight-Panel/RemoveBundleService
Removed bundle service
2023-06-05 21:34:57 +02:00
Marcel Baumgartner
4fb4a2415b Removed bundle service 2023-06-05 21:34:09 +02:00
Marcel Baumgartner
c6cf11626e Merge pull request #139 from Moonlight-Panel/ImproveConsoleStreaming
Improve console streaming
2023-06-04 21:42:13 +02:00
Marcel Baumgartner
233c304b3c Fixed error when closing a failed websocket connection 2023-06-04 21:41:15 +02:00
Marcel Baumgartner
343e527fb6 Added message cache clear for console streaming 2023-06-04 20:56:47 +02:00
Daniel Balk
25da3c233e Merge pull request #138 from Dannyx1604/main
Ein paar kleine Änderungen ;-)
2023-06-03 12:48:43 +02:00
Dannyx
d7fb3382f7 Ein paar kleine Änderungen ;-) 2023-06-03 09:06:22 +02:00
Marcel Baumgartner
88c9f5372d Merge pull request #137 from Moonlight-Panel/AddConsoleStreamingDispose
Add console streaming dispose
2023-06-01 00:44:56 +02:00
Marcel Baumgartner
7128a7f8a7 Add console streaming dispose 2023-06-01 00:44:14 +02:00
0fde9a5005 bot hotfix 2023-05-04 20:40:34 +02:00
Marcel Baumgartner
74541d7f87 Merge pull request #107 from Moonlight-Panel/main
Update to upstream branch
2023-04-29 23:39:46 +02:00
815 changed files with 11261 additions and 469662 deletions

View File

@@ -1,5 +1,4 @@
**/.classpath
**/.dockerignore
**/.dockerignore
**/.env
**/.git
**/.gitignore
@@ -8,6 +7,7 @@
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
@@ -21,5 +21,10 @@
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/appsettings.json
**/appsettings.Development.json
**/appsettings*
**/compose.*
**/.env.example
LICENSE
README.md

10
.env.example Normal file
View File

@@ -0,0 +1,10 @@
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=user
DATABASE_PASSWORD=user
DATABASE_DATABASE=user
OIDC_AUTHORITY=http://localhost:8092
OIDC_AUTHORITY=http://localhost:8092
OIDC_CLIENT_ID=client_id
OIDC_CLIENT_SECRET=client_secret
OIDC_REQUIRE_HTTPS_METADATA=false

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

View File

@@ -0,0 +1,66 @@
name: "Dev Publish: Nuget"
on:
workflow_dispatch:
push:
branches:
- v2.1
paths:
- 'Moonlight.*/*.csproj'
jobs:
publish:
name: Publish Dev Packages
runs-on: linux_amd64
steps:
- name: Check out repository code
uses: actions/checkout@v4
# Publish api server
- name: Build project
run: dotnet build Moonlight.Api --configuration Debug
- name: Publish NuGet package
run: dotnet pack Moonlight.Api --configuration Debug --output ./artifacts
- name: Push nuget package
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }}
- name: Remove artifacts
run: rm -rf ./artifacts
# Publish frontend
# We need to build it first so the class list files generate
- name: Build project
run: dotnet build Moonlight.Frontend --configuration Debug
- name: Build tailwind styles and extract class list
working-directory: Hosts/Moonlight.Frontend.Host/Styles
run: npm install && npm run build
- name: Build project
run: dotnet build Moonlight.Frontend --configuration Debug
- name: Publish NuGet package
run: dotnet pack Moonlight.Frontend --configuration Debug --output ./artifacts
- name: Push nuget package
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }}
- name: Remove artifacts
run: rm -rf ./artifacts
# Publish shared
- name: Build project
run: dotnet build Moonlight.Shared --configuration Debug
- name: Publish NuGet package
run: dotnet pack Moonlight.Shared --configuration Debug --output ./artifacts
- name: Push nuget package
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }}
- name: Remove artifacts
run: rm -rf ./artifacts

View File

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

437
.gitignore vendored
View File

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

View File

@@ -1,13 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/projectSettingsUpdater.xml
/modules.xml
/.idea.Moonlight.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

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

View File

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

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

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

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

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

6
.idea/vcs.xml generated
View File

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

View File

@@ -0,0 +1,6 @@
<Project>
<ItemGroup>
<!-- Put your plugin references here -->
<!-- E.g. <PackageReference Include="MoonlightServers.Api" Version="2.1.0" /> -->
</ItemGroup>
</Project>

View File

@@ -0,0 +1,77 @@
# Base image
FROM git.battlestati.one/moonlight-panel/app_base:moonlight AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# Install required packages
RUN apt-get update; apt-get install unzip -y; apt-get clean
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:${PATH}"
# Build options
ARG BUILD_CONFIGURATION=Release
# Download npm packages
WORKDIR /src/Hosts/Moonlight.Frontend.Host/Styles
COPY ["Hosts/Moonlight.Frontend.Host/Styles/package.json", "package.json"]
RUN bun install
# Restore nuget packages
WORKDIR /src
COPY ["Moonlight.Api/Moonlight.Api.csproj", "Moonlight.Api/"]
COPY ["Moonlight.Frontend/Moonlight.Frontend.csproj", "Moonlight.Frontend/"]
COPY ["Moonlight.Shared/Moonlight.Shared.csproj", "Moonlight.Shared/"]
COPY ["Hosts/Moonlight.Frontend.Host/Moonlight.Frontend.Host.csproj", "Hosts/Moonlight.Frontend.Host/"]
COPY ["Hosts/Moonlight.Api.Host/Moonlight.Api.Host.csproj", "Hosts/Moonlight.Api.Host/"]
COPY ["Hosts/Moonlight.Frontend.Host/Frontend.props", "Hosts/Moonlight.Frontend.Host/"]
COPY ["Hosts/Moonlight.Api.Host/Api.props", "Hosts/Moonlight.Api.Host/"]
RUN dotnet restore "Hosts/Moonlight.Api.Host/Moonlight.Api.Host.csproj"
RUN dotnet restore "Hosts/Moonlight.Frontend.Host/Moonlight.Frontend.Host.csproj"
# Copy over the whole sources
COPY . .
# Build styles
# We need to build it before, so the class lists get generated
WORKDIR "/src/Hosts/Moonlight.Frontend.Host"
RUN dotnet build "./Moonlight.Frontend.Host.csproj" -c $BUILD_CONFIGURATION -o /app/build-frontend
WORKDIR "/src/Hosts/Moonlight.Frontend.Host/Styles"
RUN bun run build
# Build projects
WORKDIR "/src/Hosts/Moonlight.Api.Host"
RUN dotnet build "./Moonlight.Api.Host.csproj" -c $BUILD_CONFIGURATION -o /app/build-api
WORKDIR "/src/Hosts/Moonlight.Frontend.Host"
RUN dotnet build "./Moonlight.Frontend.Host.csproj" -c $BUILD_CONFIGURATION -o /app/build-frontend
FROM build AS publish
# Publish options
ARG BUILD_CONFIGURATION=Release
# Publish applications
WORKDIR "/src/Hosts/Moonlight.Api.Host"
RUN dotnet publish "./Moonlight.Api.Host.csproj" -c $BUILD_CONFIGURATION -o /app/publish-api /p:UseAppHost=false
WORKDIR "/src/Hosts/Moonlight.Frontend.Host"
RUN dotnet publish "./Moonlight.Frontend.Host.csproj" -c $BUILD_CONFIGURATION -o /app/publish-frontend /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish-api .
COPY --from=publish /app/publish-frontend/wwwroot ./wwwroot
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD ["/usr/bin/curl", "-sf", "-o", "/dev/null", "http://localhost:8080/"]
ENTRYPOINT ["dotnet", "Moonlight.Api.Host.dll"]

View File

@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SimplePlugin" Version="1.0.2" />
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Moonlight.Api\Moonlight.Api.csproj"/>
<ProjectReference Include="..\Moonlight.Frontend.Host\Moonlight.Frontend.Host.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>
<Import Project="Api.props"/>
</Project>

View File

@@ -0,0 +1,9 @@
using Moonlight.Api;
using SimplePlugin.Generated;
var plugins = PluginRegistry
.Modules
.OfType<MoonlightPlugin>()
.ToArray();
await StartupHandler.RunAsync(args, plugins);

View File

@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5240",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,6 @@
<Project>
<ItemGroup>
<!-- Put your plugin references here -->
<!-- E.g. <PackageReference Include="MoonlightServers.Frontend" Version="2.1.0" /> -->
</ItemGroup>
</Project>

View File

@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<StaticWebAssetsEnabled>True</StaticWebAssetsEnabled>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<WasmEnableSIMD>true</WasmEnableSIMD>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" PrivateAssets="all"/>
<PackageReference Include="SimplePlugin" Version="1.0.2" />
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Moonlight.Frontend\Moonlight.Frontend.csproj" />
</ItemGroup>
<Import Project="Frontend.props"/>
</Project>

View File

@@ -0,0 +1,9 @@
using Moonlight.Frontend;
using SimplePlugin.Generated;
var plugins = PluginRegistry
.Modules
.OfType<MoonlightPlugin>()
.ToArray();
await StartupHandler.RunAsync(args, plugins);

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5250",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,25 @@
import fs from 'fs';
import selectorParser from 'postcss-selector-parser';
export default function extractTailwindClasses(opts = {}) {
const classSet = new Set();
return {
postcssPlugin: 'extract-tailwind-classes',
Rule(rule) {
selectorParser(selectors => {
selectors.walkClasses(node => {
classSet.add(node.value);
});
}).processSync(rule.selector);
},
OnceExit() {
const classArray = Array.from(classSet).sort();
fs.mkdirSync('../../../Moonlight.Frontend/Styles', { recursive: true });
fs.writeFileSync('../../../Moonlight.Frontend/Styles/Moonlight.Frontend.map', classArray.join('\n'));
console.log(`Extracted classes ${classArray.length}`);
}
};
}
extractTailwindClasses.postcss = true;

View File

@@ -0,0 +1,19 @@
{
"scripts": {
"dev": "npx postcss styles.css -o ../wwwroot/style.min.css --watch",
"dev-build": "npx postcss styles.css -o ../wwwroot/style.min.css",
"build": "cross-env EXTRACT_CLASSES=true npx postcss styles.css -o ../wwwroot/style.min.css"
},
"dependencies": {
"@tailwindcss/postcss": "^4.1.18",
"cssnano": "^7.1.2",
"postcss": "^8.5.6",
"postcss-cli": "^11.0.1",
"postcss-selector-parser": "^7.1.1",
"tailwindcss": "^4.1.18",
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"cross-env": "^10.1.0"
}
}

View File

@@ -0,0 +1,18 @@
import tailwindcss from '@tailwindcss/postcss';
import cssnano from 'cssnano';
import extractTailwindClasses from './extract-classes.mjs';
const plugins = [
tailwindcss,
cssnano({
preset: 'default'
})
];
if (process.env.EXTRACT_CLASSES === "true") {
plugins.push(extractTailwindClasses());
}
export default {
plugins
};

View File

@@ -0,0 +1,31 @@
@import "tailwindcss";
@import "tw-animate-css";
@import "../bin/ShadcnBlazor/scrollbar.css";
@import "../bin/ShadcnBlazor/default-theme.css";
@import "./theme.css";
@source "../bin/ShadcnBlazor/ShadcnBlazor.map";
@source "../../../Moonlight.Api/**/*.razor";
@source "../../../Moonlight.Api/**/*.cs";
@source "../../../Moonlight.Api/**/*.html";
@source "../../../Moonlight.Frontend/**/*.razor";
@source "../../../Moonlight.Frontend/**/*.cs";
@source "../../../Moonlight.Frontend/**/*.html";
@custom-variant dark (&:is(.dark *));
#blazor-error-ui {
display: none;
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}

View File

@@ -0,0 +1,132 @@
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.129 0.042 264.695);
--card: oklch(1 0 0);
--card-foreground: oklch(0.129 0.042 264.695);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.129 0.042 264.695);
--primary: oklch(0.208 0.042 265.755);
--primary-foreground: oklch(0.984 0.003 247.858);
--secondary: oklch(0.968 0.007 247.896);
--secondary-foreground: oklch(0.208 0.042 265.755);
--muted: oklch(0.968 0.007 247.896);
--muted-foreground: oklch(0.554 0.046 257.417);
--accent: oklch(0.968 0.007 247.896);
--accent-foreground: oklch(0.208 0.042 265.755);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.929 0.013 255.508);
--input: oklch(0.929 0.013 255.508);
--ring: oklch(0.704 0.04 256.788);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: var(--background);
--sidebar-foreground: var(--foreground);
--sidebar-primary: var(--primary);
--sidebar-primary-foreground: var(--primary-foreground);
--sidebar-accent: var(--accent);
--sidebar-accent-foreground: var(--accent-foreground);
--sidebar-border: var(--border);
--sidebar-ring: var(--ring);
--font-sans: Inter, sans-serif;
--font-serif: Georgia, serif;
}
.dark {
/* Deep blue-slate background with purple undertones */
--background: oklch(0.16 0.028 260);
--foreground: oklch(0.98 0.008 260);
/* Cards with slightly lighter blue-slate */
--card: oklch(0.21 0.032 260);
--card-foreground: oklch(0.98 0.008 260);
/* Popovers with medium depth */
--popover: oklch(0.24 0.035 260);
--popover-foreground: oklch(0.98 0.008 260);
/* Vibrant blue-purple primary */
--primary: oklch(0.62 0.18 270);
--primary-foreground: oklch(0.99 0.005 260);
/* Secondary with blue-slate tone */
--secondary: oklch(0.27 0.038 260);
--secondary-foreground: oklch(0.98 0.008 260);
/* Muted elements */
--muted: oklch(0.25 0.035 260);
--muted-foreground: oklch(0.66 0.025 260);
/* Accent with purple-blue blend */
--accent: oklch(0.36 0.065 268);
--accent-foreground: oklch(0.98 0.008 260);
/* Destructive red with good contrast */
--destructive: oklch(0.62 0.22 25);
--destructive-foreground: oklch(0.99 0.005 260);
/* Subtle borders and inputs */
--border: oklch(0.32 0.025 260);
--input: oklch(0.30 0.030 260);
--ring: oklch(0.62 0.18 270);
/* Chart colors with blue-purple harmony */
--chart-1: oklch(0.58 0.18 270);
--chart-2: oklch(0.62 0.16 245);
--chart-3: oklch(0.68 0.15 290);
--chart-4: oklch(0.60 0.20 260);
--chart-5: oklch(0.65 0.14 280);
/* Sidebar with slightly different depth */
--sidebar: oklch(0.18 0.030 260);
--sidebar-foreground: oklch(0.97 0.008 260);
--sidebar-primary: oklch(0.60 0.17 270);
--sidebar-primary-foreground: oklch(0.99 0.005 260);
--sidebar-accent: oklch(0.26 0.038 260);
--sidebar-accent-foreground: oklch(0.98 0.008 260);
--sidebar-border: oklch(0.30 0.025 260);
--sidebar-ring: oklch(0.58 0.17 270);
}
@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}

View File

@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Moonlight</title>
<base href="/" />
<link rel="preload" id="webassembly" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=fallback" />
<link rel="stylesheet" href="style.min.css" />
<script type="importmap"></script>
<script>
window.frontendConfig = {
STYLE_TAG_ID: 'theme-variables',
configuration: {},
applyTheme: function(cssContent) {
// Find or create the style tag
let styleTag = document.getElementById(this.STYLE_TAG_ID);
if (!styleTag) {
styleTag = document.createElement('style');
styleTag.id = this.STYLE_TAG_ID;
document.head.appendChild(styleTag);
}
// Update the style tag content
styleTag.textContent = cssContent;
},
reloadConfiguration: function (){
try {
const xhr = new XMLHttpRequest();
xhr.open('GET', '/api/frontend/config', false);
xhr.send(null);
if (xhr.status === 200) {
this.configuration = JSON.parse(xhr.responseText);
}
} catch (error) {
console.error('Failed to load initial theme:', error);
}
},
getConfiguration: function (){
return this.configuration;
},
reload: function () {
this.reloadConfiguration();
document.title = this.configuration.name;
this.applyTheme(this.configuration.themeCss);
}
};
window.frontendConfig.reload();
</script>
</head>
<body class="bg-background text-foreground">
<div id="app">
<div class="h-screen w-full flex items-center justify-center">
<div class="flex min-w-0 flex-1 flex-col items-center justify-center gap-3 rounded-lg border-dashed p-6 text-center text-balance md:p-12">
<div class="flex max-w-sm flex-col items-center gap-2 text-center">
<div class="flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0 bg-muted text-foreground size-10 rounded-lg [&_svg:not([class*='size-'])]:size-6">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-zap-icon lucide-zap size-6">
<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>
</svg>
</div>
</div>
<div class="text-lg font-medium tracking-tight">
Loading application
</div>
<div class="flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance">
<div class="bg-primary/20 w-full relative h-2 overflow-hidden rounded-full">
<div class="bg-primary h-full w-[var(--blazor-load-percentage,0)] flex-1 transition-all">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="." class="reload">Reload</a>
<span class="dismiss">🗙</span>
</div>
<script src="/_content/ShadcnBlazor/interop.js" defer></script>
<script src="/_content/ShadcnBlazor.Extras/interop.js" defer></script>
<script src="/_content/ShadcnBlazor.Extras/codemirror-bundle.js" defer></script>
<script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script>
</body>
</html>

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

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class ApiOptions
{
public TimeSpan LookupCacheL1Expiry { get; set; } = TimeSpan.FromSeconds(30);
public TimeSpan LookupCacheL2Expiry { get; set; } = TimeSpan.FromMinutes(3);
}

View File

@@ -0,0 +1,6 @@
namespace Moonlight.Api.Configuration;
public class CacheOptions
{
public bool EnableLayer2 { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class ContainerHelperOptions
{
public bool IsEnabled { get; set; }
public string Url { get; set; } = "http://helper:8080";
}

View File

@@ -0,0 +1,10 @@
namespace Moonlight.Api.Configuration;
public class DatabaseOptions
{
public string Host { get; set; }
public int Port { get; set; } = 5432;
public string Username { get; set; }
public string Password { get; set; }
public string Database { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class FrontendOptions
{
public bool Enabled { get; set; } = true;
public int CacheMinutes { get; set; } = 3;
}

View File

@@ -0,0 +1,12 @@
namespace Moonlight.Api.Configuration;
public class OidcOptions
{
public string Authority { get; set; }
public bool RequireHttpsMetadata { get; set; } = true;
public bool DisableHttpsOnlyCookies { get; set; }
public string ResponseType { get; set; } = "code";
public string[]? Scopes { get; set; }
public string ClientId { get; set; }
public string ClientSecret { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class RedisOptions
{
public bool Enable { get; set; }
public string ConnectionString { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class SettingsOptions
{
public TimeSpan LookupL1CacheTime { get; set; } = TimeSpan.FromMinutes(1);
public TimeSpan LookupL2CacheTime { get; set; } = TimeSpan.FromMinutes(5);
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class UserOptions
{
public TimeSpan ValidationCacheL1Expiry { get; set; } = TimeSpan.FromSeconds(30);
public TimeSpan ValidationCacheL2Expiry { get; set; } = TimeSpan.FromMinutes(3);
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Configuration;
public class VersionOptions
{
public bool OfflineMode { get; set; }
public string? CurrentOverride { get; set; }
}

View File

@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Moonlight.Api.Configuration;
using Moonlight.Api.Database.Entities;
namespace Moonlight.Api.Database;
public class DataContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<SettingsOption> SettingsOptions { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<RoleMember> RoleMembers { get; set; }
public DbSet<ApiKey> ApiKeys { get; set; }
public DbSet<Theme> Themes { get; set; }
private readonly IOptions<DatabaseOptions> Options;
public DataContext(IOptions<DatabaseOptions> options)
{
Options = options;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured)
return;
optionsBuilder.UseNpgsql(
$"Host={Options.Value.Host};" +
$"Port={Options.Value.Port};" +
$"Username={Options.Value.Username};" +
$"Password={Options.Value.Password};" +
$"Database={Options.Value.Database}"
);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("core");
base.OnModelCreating(modelBuilder);
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database.Interfaces;
namespace Moonlight.Api.Database;
public class DatabaseRepository<T> where T : class
{
private readonly DataContext DataContext;
private readonly DbSet<T> Set;
public DatabaseRepository(DataContext dataContext)
{
DataContext = dataContext;
Set = DataContext.Set<T>();
}
public IQueryable<T> Query() => Set;
public async Task<T> AddAsync(T entity)
{
if (entity is IActionTimestamps actionTimestamps)
{
actionTimestamps.CreatedAt = DateTimeOffset.UtcNow;
actionTimestamps.UpdatedAt = DateTimeOffset.UtcNow;
}
var final = Set.Add(entity);
await DataContext.SaveChangesAsync();
return final.Entity;
}
public async Task UpdateAsync(T entity)
{
if (entity is IActionTimestamps actionTimestamps)
actionTimestamps.UpdatedAt = DateTimeOffset.UtcNow;
Set.Update(entity);
await DataContext.SaveChangesAsync();
}
public async Task RemoveAsync(T entity)
{
Set.Remove(entity);
await DataContext.SaveChangesAsync();
}
}

View File

@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using Moonlight.Api.Database.Interfaces;
namespace Moonlight.Api.Database.Entities;
public class ApiKey : IActionTimestamps
{
public int Id { get; set; }
[MaxLength(30)]
public required string Name { get; set; }
[MaxLength(300)]
public required string Description { get; set; }
public string[] Permissions { get; set; } = [];
public DateTimeOffset ValidUntil { get; set; }
[MaxLength(32)]
public string Key { get; set; }
// Action timestamps
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
}

View File

@@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using Moonlight.Api.Database.Interfaces;
namespace Moonlight.Api.Database.Entities;
public class Role : IActionTimestamps
{
public int Id { get; set; }
[MaxLength(30)]
public required string Name { get; set; }
[MaxLength(300)]
public required string Description { get; set; }
public string[] Permissions { get; set; } = [];
// Relations
public List<RoleMember> Members { get; set; } = [];
// Action timestamps
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
}

View File

@@ -0,0 +1,15 @@
using Moonlight.Api.Database.Interfaces;
namespace Moonlight.Api.Database.Entities;
public class RoleMember : IActionTimestamps
{
public int Id { get; set; }
public Role Role { get; set; }
public User User { get; set; }
// Action timestamps
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
}

View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Moonlight.Api.Database.Entities;
public class SettingsOption
{
public int Id { get; set; }
[MaxLength(256)]
public required string Key { get; set; }
[MaxLength(4096)]
[Column(TypeName = "jsonb")]
public required string ValueJson { get; set; }
}

View File

@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace Moonlight.Api.Database.Entities;
public class Theme
{
public int Id { get; set; }
[MaxLength(30)]
public required string Name { get; set; }
[MaxLength(30)]
public required string Version { get; set; }
[MaxLength(30)]
public required string Author { get; set; }
public bool IsEnabled { get; set; }
[MaxLength(20_000)]
public required string CssContent { get; set; }
}

View File

@@ -0,0 +1,26 @@
using System.ComponentModel.DataAnnotations;
using Moonlight.Api.Database.Interfaces;
namespace Moonlight.Api.Database.Entities;
public class User : IActionTimestamps
{
public int Id { get; set; }
// Base information
[MaxLength(50)]
public required string Username { get; set; }
[MaxLength(254)]
public required string Email { get; set; }
// Authentication
public DateTimeOffset InvalidateTimestamp { get; set; }
// Relations
public List<RoleMember> RoleMemberships { get; set; } = [];
// Action timestamps
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Moonlight.Api.Database.Interfaces;
internal interface IActionTimestamps
{
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
}

View File

@@ -0,0 +1,80 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251225202335_AddedUsersAndSettings")]
partial class AddedUsersAndSettings
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AddedUsersAndSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "core");
migrationBuilder.CreateTable(
name: "SettingsOptions",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Key = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Value = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SettingsOptions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Username = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
Email = table.Column<string>(type: "character varying(254)", maxLength: 254, nullable: false),
InvalidateTimestamp = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SettingsOptions",
schema: "core");
migrationBuilder.DropTable(
name: "Users",
schema: "core");
}
}
}

View File

@@ -0,0 +1,177 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251230200748_AddedRolesAndActionTimestamps")]
partial class AddedRolesAndActionTimestamps
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("character varying(15)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,115 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AddedRolesAndActionTimestamps : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTimeOffset>(
name: "CreatedAt",
schema: "core",
table: "Users",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
migrationBuilder.AddColumn<DateTimeOffset>(
name: "UpdatedAt",
schema: "core",
table: "Users",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
migrationBuilder.CreateTable(
name: "Roles",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "character varying(15)", maxLength: 15, nullable: false),
Description = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
Permissions = table.Column<string[]>(type: "text[]", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Roles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RoleMembers",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<int>(type: "integer", nullable: false),
UserId = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleMembers", x => x.Id);
table.ForeignKey(
name: "FK_RoleMembers_Roles_RoleId",
column: x => x.RoleId,
principalSchema: "core",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RoleMembers_Users_UserId",
column: x => x.UserId,
principalSchema: "core",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_RoleMembers_RoleId",
schema: "core",
table: "RoleMembers",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_RoleMembers_UserId",
schema: "core",
table: "RoleMembers",
column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RoleMembers",
schema: "core");
migrationBuilder.DropTable(
name: "Roles",
schema: "core");
migrationBuilder.DropColumn(
name: "CreatedAt",
schema: "core",
table: "Users");
migrationBuilder.DropColumn(
name: "UpdatedAt",
schema: "core",
table: "Users");
}
}
}

View File

@@ -0,0 +1,215 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260116133404_AddedApiKeys")]
partial class AddedApiKeys
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("character varying(15)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("character varying(15)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,43 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AddedApiKeys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ApiKeys",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "character varying(15)", maxLength: 15, nullable: false),
Description = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
Permissions = table.Column<string[]>(type: "text[]", nullable: false),
Key = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiKeys", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ApiKeys",
schema: "core");
}
}
}

View File

@@ -0,0 +1,215 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260116134322_AdjustedLenghtsOfRoleAndApiKeyStrings")]
partial class AdjustedLenghtsOfRoleAndApiKeyStrings
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,106 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AdjustedLenghtsOfRoleAndApiKeyStrings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
schema: "core",
table: "Roles",
type: "character varying(30)",
maxLength: 30,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(15)",
oldMaxLength: 15);
migrationBuilder.AlterColumn<string>(
name: "Description",
schema: "core",
table: "Roles",
type: "character varying(300)",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
migrationBuilder.AlterColumn<string>(
name: "Name",
schema: "core",
table: "ApiKeys",
type: "character varying(30)",
maxLength: 30,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(15)",
oldMaxLength: 15);
migrationBuilder.AlterColumn<string>(
name: "Description",
schema: "core",
table: "ApiKeys",
type: "character varying(300)",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
schema: "core",
table: "Roles",
type: "character varying(15)",
maxLength: 15,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(30)",
oldMaxLength: 30);
migrationBuilder.AlterColumn<string>(
name: "Description",
schema: "core",
table: "Roles",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(300)",
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "Name",
schema: "core",
table: "ApiKeys",
type: "character varying(15)",
maxLength: 15,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(30)",
oldMaxLength: 30);
migrationBuilder.AlterColumn<string>(
name: "Description",
schema: "core",
table: "ApiKeys",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(300)",
oldMaxLength: 300);
}
}
}

View File

@@ -0,0 +1,251 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260118005634_AddedThemes")]
partial class AddedThemes
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Theme", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("CssContent")
.IsRequired()
.HasMaxLength(20000)
.HasColumnType("character varying(20000)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.HasKey("Id");
b.ToTable("Themes", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,41 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AddedThemes : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Themes",
schema: "core",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
Version = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
Author = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
CssContent = table.Column<string>(type: "character varying(20000)", maxLength: 20000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Themes", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Themes",
schema: "core");
}
}
}

View File

@@ -0,0 +1,251 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260129134620_SwitchedToJsonForSettingsOption")]
partial class SwitchedToJsonForSettingsOption
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ValueJson")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("jsonb");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Theme", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("CssContent")
.IsRequired()
.HasMaxLength(20000)
.HasColumnType("character varying(20000)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.HasKey("Id");
b.ToTable("Themes", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class SwitchedToJsonForSettingsOption : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Value",
schema: "core",
table: "SettingsOptions");
migrationBuilder.AddColumn<string>(
name: "ValueJson",
schema: "core",
table: "SettingsOptions",
type: "jsonb",
maxLength: 4096,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ValueJson",
schema: "core",
table: "SettingsOptions");
migrationBuilder.AddColumn<string>(
name: "Value",
schema: "core",
table: "SettingsOptions",
type: "character varying(4096)",
maxLength: 4096,
nullable: false,
defaultValue: "");
}
}
}

View File

@@ -0,0 +1,254 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260209114238_AddedValidUntilToApiKeys")]
partial class AddedValidUntilToApiKeys
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("ValidUntil")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ValueJson")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("jsonb");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Theme", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("CssContent")
.IsRequired()
.HasMaxLength(20000)
.HasColumnType("character varying(20000)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.HasKey("Id");
b.ToTable("Themes", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
/// <inheritdoc />
public partial class AddedValidUntilToApiKeys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTimeOffset>(
name: "ValidUntil",
schema: "core",
table: "ApiKeys",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ValidUntil",
schema: "core",
table: "ApiKeys");
}
}
}

View File

@@ -0,0 +1,251 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Moonlight.Api.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Moonlight.Api.Database.Migrations
{
[DbContext(typeof(DataContext))]
partial class DataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("core")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Moonlight.Api.Database.Entities.ApiKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("ValidUntil")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("ApiKeys", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.PrimitiveCollection<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Roles", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("RoleMembers", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.SettingsOption", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ValueJson")
.IsRequired()
.HasMaxLength(4096)
.HasColumnType("jsonb");
b.HasKey("Id");
b.ToTable("SettingsOptions", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Theme", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("CssContent")
.IsRequired()
.HasMaxLength(20000)
.HasColumnType("character varying(20000)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.HasKey("Id");
b.ToTable("Themes", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(254)
.HasColumnType("character varying(254)");
b.Property<DateTimeOffset>("InvalidateTimestamp")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Users", "core");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.RoleMember", b =>
{
b.HasOne("Moonlight.Api.Database.Entities.Role", "Role")
.WithMany("Members")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Moonlight.Api.Database.Entities.User", "User")
.WithMany("RoleMemberships")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.Role", b =>
{
b.Navigation("Members");
});
modelBuilder.Entity("Moonlight.Api.Database.Entities.User", b =>
{
b.Navigation("RoleMemberships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,77 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Logging.Console;
namespace Moonlight.Api.Helpers;
public class AppConsoleFormatter : ConsoleFormatter
{
private const string TimestampColor = "\e[38;2;148;148;148m";
private const string CategoryColor = "\e[38;2;198;198;198m";
private const string MessageColor = "\e[38;2;255;255;255m";
private const string Bold = "\e[1m";
// Pre-computed ANSI color codes for each log level
private const string CriticalColor = "\e[38;2;255;0;0m";
private const string ErrorColor = "\e[38;2;255;0;0m";
private const string WarningColor = "\e[38;2;215;215;0m";
private const string InfoColor = "\e[38;2;135;215;255m";
private const string DebugColor = "\e[38;2;198;198;198m";
private const string TraceColor = "\e[38;2;68;68;68m";
public AppConsoleFormatter() : base(nameof(AppConsoleFormatter))
{
}
public override void Write<TState>(
in LogEntry<TState> logEntry,
IExternalScopeProvider? scopeProvider,
TextWriter textWriter)
{
var message = logEntry.Formatter(logEntry.State, logEntry.Exception);
// Timestamp
textWriter.Write(TimestampColor);
textWriter.Write(DateTime.Now.ToString("dd.MM.yy HH:mm:ss"));
textWriter.Write(' ');
// Log level with color and bold
var (levelText, levelColor) = GetLevelInfo(logEntry.LogLevel);
textWriter.Write(levelColor);
textWriter.Write(Bold);
textWriter.Write(levelText);
textWriter.Write(' ');
// Category
textWriter.Write(CategoryColor);
textWriter.Write(logEntry.Category);
// Message
textWriter.Write(MessageColor);
textWriter.Write(": ");
textWriter.Write(message);
// Exception
if (logEntry.Exception != null)
{
textWriter.Write(MessageColor);
textWriter.WriteLine(logEntry.Exception.ToString());
}
else
textWriter.WriteLine();
}
private static (string text, string color) GetLevelInfo(LogLevel logLevel)
{
return logLevel switch
{
LogLevel.Critical => ("CRIT", CriticalColor),
LogLevel.Error => ("ERRO", ErrorColor),
LogLevel.Warning => ("WARN", WarningColor),
LogLevel.Information => ("INFO", InfoColor),
LogLevel.Debug => ("DEBG", DebugColor),
LogLevel.Trace => ("TRCE", TraceColor),
_ => ("NONE", "")
};
}
}

View File

@@ -0,0 +1,98 @@
using System.Runtime.InteropServices;
namespace Moonlight.Api.Helpers;
public class OsHelper
{
public static string GetName()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
return GetWindowsVersion();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
return GetLinuxVersion();
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
return "Goofy OS";
return "Unknown OS";
}
private static string GetWindowsVersion()
{
var version = Environment.OSVersion.Version;
// Windows 11 is version 10.0 build 22000+
if (version.Major == 10 && version.Build >= 22000)
return $"Windows 11 ({version.Build})";
if (version.Major == 10)
return $"Windows 10 ({version.Build})";
if (version.Major == 6 && version.Minor == 3)
return "Windows 8.1";
if (version.Major == 6 && version.Minor == 2)
return "Windows 8";
if (version.Major == 6 && version.Minor == 1)
return "Windows 7";
return $"Windows {version.Major}.{version.Minor}";
}
private static string GetLinuxVersion()
{
try
{
// Read /etc/os-release, should work everywhere
if (File.Exists("/etc/os-release"))
{
var lines = File.ReadAllLines("/etc/os-release");
string? name = null;
string? version = null;
foreach (var line in lines)
{
if (line.StartsWith("NAME="))
name = line.Substring(5).Trim('"');
else if (line.StartsWith("VERSION_ID="))
version = line.Substring(11).Trim('"');
}
if (!string.IsNullOrEmpty(name))
{
return string.IsNullOrEmpty(version) ? name : $"{name} {version}";
}
}
//If for some weird reason it still uses lsb release
if (File.Exists("/etc/lsb-release"))
{
var lines = File.ReadAllLines("/etc/lsb-release");
string? name = null;
string? version = null;
foreach (var line in lines)
{
if (line.StartsWith("DISTRIB_ID="))
name = line.Substring(11);
else if (line.StartsWith("DISTRIB_RELEASE="))
version = line.Substring(16);
}
if (!string.IsNullOrEmpty(name))
{
return string.IsNullOrEmpty(version) ? name : $"{name} {version}";
}
}
}
catch
{
// Ignore
}
// Fallback
return $"Linux {Environment.OSVersion.Version}";
}
}

View File

@@ -0,0 +1,143 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Hybrid;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Implementations.ApiKeyScheme;
using Moonlight.Api.Mappers;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Requests.Admin.ApiKeys;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Http.Responses.Admin.ApiKeys;
namespace Moonlight.Api.Http.Controllers.Admin;
[Authorize]
[ApiController]
[Route("api/admin/apiKeys")]
public class ApiKeyController : Controller
{
private readonly DatabaseRepository<ApiKey> KeyRepository;
private readonly HybridCache HybridCache;
public ApiKeyController(DatabaseRepository<ApiKey> keyRepository, HybridCache hybridCache)
{
KeyRepository = keyRepository;
HybridCache = hybridCache;
}
[HttpGet]
[Authorize(Policy = Permissions.ApiKeys.View)]
public async Task<ActionResult<PagedData<ApiKeyDto>>> GetAsync(
[FromQuery] int startIndex,
[FromQuery] int length,
[FromQuery] FilterOptions? filterOptions
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = KeyRepository.Query();
// Filters
if (filterOptions != null)
{
foreach (var filterOption in filterOptions.Filters)
{
query = filterOption.Key switch
{
nameof(ApiKey.Name) =>
query.Where(k => EF.Functions.ILike(k.Name, $"%{filterOption.Value}%")),
nameof(ApiKey.Description) =>
query.Where(k => EF.Functions.ILike(k.Description, $"%{filterOption.Value}%")),
_ => query
};
}
}
// Pagination
var data = await query
.OrderBy(k => k.Id)
.ProjectToDto()
.Skip(startIndex)
.Take(length)
.ToArrayAsync();
var total = await query.CountAsync();
return new PagedData<ApiKeyDto>(data, total);
}
[HttpGet("{id:int}")]
[Authorize(Policy = Permissions.ApiKeys.View)]
public async Task<ActionResult<ApiKeyDto>> GetAsync([FromRoute] int id)
{
var key = await KeyRepository
.Query()
.FirstOrDefaultAsync(k => k.Id == id);
if (key == null)
return Problem("No API key with this id found", statusCode: 404);
return ApiKeyMapper.ToDto(key);
}
[HttpPost]
[Authorize(Policy = Permissions.ApiKeys.Create)]
public async Task<ActionResult<ApiKeyDto>> CreateAsync([FromBody] CreateApiKeyDto request)
{
var apiKey = ApiKeyMapper.ToEntity(request);
apiKey.Key = Guid.NewGuid().ToString("N").Substring(0, 32);
var finalKey = await KeyRepository.AddAsync(apiKey);
return ApiKeyMapper.ToDto(finalKey);
}
[HttpPatch("{id:int}")]
[Authorize(Policy = Permissions.ApiKeys.Edit)]
public async Task<ActionResult<ApiKeyDto>> UpdateAsync([FromRoute] int id, [FromBody] UpdateApiKeyDto request)
{
var apiKey = await KeyRepository
.Query()
.FirstOrDefaultAsync(k => k.Id == id);
if (apiKey == null)
return Problem("No API key with this id found", statusCode: 404);
ApiKeyMapper.Merge(apiKey, request);
await KeyRepository.UpdateAsync(apiKey);
await HybridCache.RemoveAsync(string.Format(ApiKeySchemeHandler.CacheKeyFormat, apiKey.Key));
return ApiKeyMapper.ToDto(apiKey);
}
[HttpDelete("{id:int}")]
[Authorize(Policy = Permissions.ApiKeys.Delete)]
public async Task<ActionResult> DeleteAsync([FromRoute] int id)
{
var apiKey = await KeyRepository
.Query()
.FirstOrDefaultAsync(k => k.Id == id);
if (apiKey == null)
return Problem("No API key with this id found", statusCode: 404);
await KeyRepository.RemoveAsync(apiKey);
await HybridCache.RemoveAsync(string.Format(ApiKeySchemeHandler.CacheKeyFormat, apiKey.Key));
return NoContent();
}
}

View File

@@ -0,0 +1,56 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Moonlight.Api.Configuration;
using Moonlight.Api.Mappers;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests.Admin.ContainerHelper;
using Moonlight.Shared.Http.Responses.Admin;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Route("api/admin/ch")]
[Authorize(Policy = Permissions.System.Instance)]
public class ContainerHelperController : Controller
{
private readonly ContainerHelperService ContainerHelperService;
private readonly IOptions<ContainerHelperOptions> Options;
public ContainerHelperController(ContainerHelperService containerHelperService, IOptions<ContainerHelperOptions> options)
{
ContainerHelperService = containerHelperService;
Options = options;
}
[HttpGet("status")]
public async Task<ActionResult<ContainerHelperStatusDto>> GetStatusAsync()
{
if (!Options.Value.IsEnabled)
return new ContainerHelperStatusDto(false, false);
var status = await ContainerHelperService.CheckConnectionAsync();
return new ContainerHelperStatusDto(true, status);
}
[HttpPost("rebuild")]
public Task<IResult> RebuildAsync([FromBody] RequestRebuildDto request)
{
var result = ContainerHelperService.RebuildAsync(request.NoBuildCache);
var mappedResult = result.Select(ContainerHelperMapper.ToDto);
return Task.FromResult<IResult>(
TypedResults.ServerSentEvents(mappedResult)
);
}
[HttpPost("version")]
public async Task<ActionResult> SetVersionAsync([FromBody] SetVersionDto request)
{
await ContainerHelperService.SetVersionAsync(request.Version);
return NoContent();
}
}

View File

@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Moonlight.Api.Mappers;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Responses.Admin;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Authorize(Policy = Permissions.System.Diagnose)]
[Route("api/admin/system/diagnose")]
public class DiagnoseController : Controller
{
private readonly DiagnoseService DiagnoseService;
public DiagnoseController(DiagnoseService diagnoseService)
{
DiagnoseService = diagnoseService;
}
[HttpGet]
public async Task<ActionResult<DiagnoseResultDto[]>> GetAsync()
{
var results = await DiagnoseService.DiagnoseAsync();
return results
.OrderBy(x => x.Level)
.ToDto()
.ToArray();
}
}

View File

@@ -0,0 +1,171 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Mappers;
using Moonlight.Shared;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Http.Responses.Admin.Users;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Authorize(Policy = Permissions.Roles.Members)]
[Route("api/admin/roles/{roleId:int}/members")]
public class RoleMembersController : Controller
{
private readonly DatabaseRepository<User> UsersRepository;
private readonly DatabaseRepository<Role> RolesRepository;
private readonly DatabaseRepository<RoleMember> RoleMembersRepository;
public RoleMembersController(
DatabaseRepository<User> usersRepository,
DatabaseRepository<Role> rolesRepository,
DatabaseRepository<RoleMember> roleMembersRepository
)
{
UsersRepository = usersRepository;
RolesRepository = rolesRepository;
RoleMembersRepository = roleMembersRepository;
}
[HttpGet]
public async Task<ActionResult<PagedData<UserDto>>> GetAsync(
[FromRoute] int roleId,
[FromQuery] int startIndex, [FromQuery] int length,
[FromQuery] string? searchTerm
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = RoleMembersRepository
.Query()
.Where(x => x.Role.Id == roleId)
.Select(x => x.User);
// Filtering
if (!string.IsNullOrWhiteSpace(searchTerm))
{
query = query.Where(x =>
EF.Functions.ILike(x.Username, $"%{searchTerm}%") ||
EF.Functions.ILike(x.Email, $"%{searchTerm}%")
);
}
// Pagination
var items = query
.OrderBy(x => x.Id)
.Skip(startIndex)
.Take(length)
.ProjectToDto()
.ToArray();
var totalCount = await query.CountAsync();
return new PagedData<UserDto>(items, totalCount);
}
[HttpGet("available")]
public async Task<ActionResult<PagedData<UserDto>>> GetAvailableAsync(
[FromRoute] int roleId,
[FromQuery] int startIndex, [FromQuery] int length,
[FromQuery] string? searchTerm
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = UsersRepository
.Query()
.Where(x => x.RoleMemberships.All(y => y.Role.Id != roleId));
// Filtering
if (!string.IsNullOrWhiteSpace(searchTerm))
{
query = query.Where(x =>
EF.Functions.ILike(x.Username, $"%{searchTerm}%") ||
EF.Functions.ILike(x.Email, $"%{searchTerm}%")
);
}
// Pagination
var items = query
.OrderBy(x => x.Id)
.Skip(startIndex)
.Take(length)
.ProjectToDto()
.ToArray();
var totalCount = await query.CountAsync();
return new PagedData<UserDto>(items, totalCount);
}
[HttpPut("{userId:int}")]
public async Task<ActionResult> AddMemberAsync([FromRoute] int roleId, [FromRoute] int userId)
{
// Check and load role
var role = await RolesRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == roleId);
if (role == null)
return Problem("Role not found", statusCode: 404);
// Check and load user
var user = await UsersRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == userId);
if (user == null)
return Problem("User not found", statusCode: 404);
// Check if a role member already exists with these details
var isUserInRole = await RoleMembersRepository
.Query()
.AnyAsync(x => x.Role.Id == roleId && x.User.Id == userId);
if (isUserInRole)
return Problem("User is already a member of this role", statusCode: 400);
var roleMember = new RoleMember
{
Role = role,
User = user
};
await RoleMembersRepository.AddAsync(roleMember);
return NoContent();
}
[HttpDelete("{userId:int}")]
public async Task<ActionResult> RemoveMemberAsync([FromRoute] int roleId, [FromRoute] int userId)
{
var roleMember = await RoleMembersRepository
.Query()
.FirstOrDefaultAsync(x => x.User.Id == userId && x.Role.Id == roleId);
if (roleMember == null)
return Problem("User is not a member of this role, the role does not exist or the user does not exist",
statusCode: 404);
await RoleMembersRepository.RemoveAsync(roleMember);
return NoContent();
}
}

View File

@@ -0,0 +1,131 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Mappers;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Requests.Admin.Roles;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Http.Responses.Admin;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Route("api/admin/roles")]
public class RolesController : Controller
{
private readonly DatabaseRepository<Role> RoleRepository;
public RolesController(DatabaseRepository<Role> roleRepository)
{
RoleRepository = roleRepository;
}
[HttpGet]
[Authorize(Policy = Permissions.Roles.View)]
public async Task<ActionResult<PagedData<RoleDto>>> GetAsync(
[FromQuery] int startIndex,
[FromQuery] int length,
[FromQuery] FilterOptions? filterOptions
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = RoleRepository
.Query();
// Filters
if (filterOptions != null)
{
foreach (var filterOption in filterOptions.Filters)
{
query = filterOption.Key switch
{
nameof(Role.Name) =>
query.Where(role => EF.Functions.ILike(role.Name, $"%{filterOption.Value}%")),
_ => query
};
}
}
// Pagination
var data = await query
.OrderBy(x => x.Id)
.ProjectToDto()
.Skip(startIndex)
.Take(length)
.ToArrayAsync();
var total = await query.CountAsync();
return new PagedData<RoleDto>(data, total);
}
[HttpGet("{id:int}")]
[Authorize(Policy = Permissions.Roles.View)]
public async Task<ActionResult<RoleDto>> GetAsync([FromRoute] int id)
{
var role = await RoleRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (role == null)
return Problem("No role with this id found", statusCode: 404);
return RoleMapper.ToDto(role);
}
[HttpPost]
[Authorize(Policy = Permissions.Roles.Create)]
public async Task<ActionResult<RoleDto>> CreateAsync([FromBody] CreateRoleDto request)
{
var role = RoleMapper.ToEntity(request);
var finalRole = await RoleRepository.AddAsync(role);
return RoleMapper.ToDto(finalRole);
}
[HttpPatch("{id:int}")]
[Authorize(Policy = Permissions.Roles.Edit)]
public async Task<ActionResult<RoleDto>> UpdateAsync([FromRoute] int id, [FromBody] UpdateRoleDto request)
{
var role = await RoleRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (role == null)
return Problem("No role with this id found", statusCode: 404);
RoleMapper.Merge(role, request);
await RoleRepository.UpdateAsync(role);
return RoleMapper.ToDto(role);
}
[HttpDelete("{id:int}")]
[Authorize(Policy = Permissions.Roles.Delete)]
public async Task<ActionResult> DeleteAsync([FromRoute] int id)
{
var role = await RoleRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (role == null)
return Problem("No role with this id found", statusCode: 404);
await RoleRepository.RemoveAsync(role);
return NoContent();
}
}

View File

@@ -0,0 +1,129 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests.Seup;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Route("api/admin/setup")]
public class SetupController : Controller
{
private readonly SettingsService SettingsService;
private readonly DatabaseRepository<User> UsersRepository;
private readonly DatabaseRepository<Role> RolesRepository;
private const string StateSettingsKey = "Moonlight.Api.Setup.State";
public SetupController(
SettingsService settingsService,
DatabaseRepository<User> usersRepository,
DatabaseRepository<Role> rolesRepository
)
{
SettingsService = settingsService;
UsersRepository = usersRepository;
RolesRepository = rolesRepository;
}
[HttpGet]
[AllowAnonymous]
public async Task<ActionResult> GetSetupAsync()
{
var hasBeenSetup = await SettingsService.GetValueAsync<bool>(StateSettingsKey);
if (hasBeenSetup)
return Problem("This instance is already configured", statusCode: 405);
return NoContent();
}
[HttpPost]
[AllowAnonymous]
public async Task<ActionResult> ApplySetupAsync([FromBody] ApplySetupDto dto)
{
var adminRole = await RolesRepository
.Query()
.FirstOrDefaultAsync(x => x.Name == "Administrators");
if (adminRole == null)
{
adminRole = await RolesRepository.AddAsync(new Role()
{
Name = "Administrators",
Description = "Automatically generated group for full administrator permissions",
Permissions = [
Permissions.ApiKeys.View,
Permissions.ApiKeys.Create,
Permissions.ApiKeys.Edit,
Permissions.ApiKeys.Delete,
Permissions.Roles.View,
Permissions.Roles.Create,
Permissions.Roles.Edit,
Permissions.Roles.Delete,
Permissions.Roles.Members,
Permissions.Users.View,
Permissions.Users.Create,
Permissions.Users.Edit,
Permissions.Users.Delete,
Permissions.Users.Logout,
Permissions.Themes.View,
Permissions.Themes.Create,
Permissions.Themes.Edit,
Permissions.Themes.Delete,
Permissions.System.Info,
Permissions.System.Diagnose,
Permissions.System.Versions,
Permissions.System.Instance,
]
});
}
var user = await UsersRepository
.Query()
.FirstOrDefaultAsync(u => u.Email == dto.AdminEmail);
if (user == null)
{
await UsersRepository.AddAsync(new User()
{
Email = dto.AdminEmail,
Username = dto.AdminUsername,
RoleMemberships = [
new RoleMember()
{
Role = adminRole,
CreatedAt = DateTimeOffset.UtcNow,
UpdatedAt = DateTimeOffset.UtcNow
}
],
CreatedAt = DateTimeOffset.UtcNow,
UpdatedAt = DateTimeOffset.UtcNow
});
}
else
{
user.RoleMemberships.Add(new RoleMember()
{
Role = adminRole,
CreatedAt = DateTimeOffset.UtcNow,
UpdatedAt = DateTimeOffset.UtcNow
});
await UsersRepository.UpdateAsync(user);
}
await SettingsService.SetValueAsync(StateSettingsKey, true);
return NoContent();
}
}

View File

@@ -0,0 +1,36 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Responses.Admin;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Route("api/admin/system")]
public class SystemController : Controller
{
private readonly ApplicationService ApplicationService;
public SystemController(ApplicationService applicationService)
{
ApplicationService = applicationService;
}
[HttpGet("info")]
[Authorize(Policy = Permissions.System.Info)]
public async Task<ActionResult<SystemInfoDto>> GetInfoAsync()
{
var cpuUsage = await ApplicationService.GetCpuUsageAsync();
var memoryUsage = await ApplicationService.GetMemoryUsageAsync();
return new SystemInfoDto(
cpuUsage,
memoryUsage,
ApplicationService.OperatingSystem,
DateTimeOffset.UtcNow - ApplicationService.StartedAt,
ApplicationService.VersionName,
ApplicationService.IsUpToDate
);
}
}

View File

@@ -0,0 +1,145 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Mappers;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Requests.Admin.Themes;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Http.Responses.Admin.Themes;
namespace Moonlight.Api.Http.Controllers.Admin.Themes;
[ApiController]
[Route("api/admin/themes")]
public class ThemesController : Controller
{
private readonly DatabaseRepository<Theme> ThemeRepository;
private readonly FrontendService FrontendService;
public ThemesController(DatabaseRepository<Theme> themeRepository, FrontendService frontendService)
{
ThemeRepository = themeRepository;
FrontendService = frontendService;
}
[HttpGet]
[Authorize(Policy = Permissions.Themes.View)]
public async Task<ActionResult<PagedData<ThemeDto>>> GetAsync(
[FromQuery] int startIndex,
[FromQuery] int length,
[FromQuery] FilterOptions? filterOptions
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = ThemeRepository
.Query();
// Filters
if (filterOptions != null)
{
foreach (var filterOption in filterOptions.Filters)
{
query = filterOption.Key switch
{
nameof(Theme.Name) =>
query.Where(user => EF.Functions.ILike(user.Name, $"%{filterOption.Value}%")),
nameof(Theme.Version) =>
query.Where(user => EF.Functions.ILike(user.Version, $"%{filterOption.Value}%")),
nameof(Theme.Author) =>
query.Where(user => EF.Functions.ILike(user.Author, $"%{filterOption.Value}%")),
_ => query
};
}
}
// Pagination
var data = await query
.OrderBy(x => x.Id)
.ProjectToDto()
.Skip(startIndex)
.Take(length)
.ToArrayAsync();
var total = await query.CountAsync();
return new PagedData<ThemeDto>(data, total);
}
[HttpGet("{id:int}")]
[Authorize(Policy = Permissions.Themes.View)]
public async Task<ActionResult<ThemeDto>> GetAsync([FromRoute] int id)
{
var item = await ThemeRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (item == null)
return Problem("No theme with this id", statusCode: 404);
return ThemeMapper.ToDto(item);
}
[HttpPost]
[Authorize(Policy = Permissions.Themes.Create)]
public async Task<ActionResult<ThemeDto>> CreateAsync([FromBody] CreateThemeDto request)
{
var theme = ThemeMapper.ToEntity(request);
var finalTheme = await ThemeRepository.AddAsync(theme);
await FrontendService.ResetCacheAsync();
return ThemeMapper.ToDto(finalTheme);
}
[HttpPatch("{id:int}")]
[Authorize(Policy = Permissions.Themes.Edit)]
public async Task<ActionResult<ThemeDto>> UpdateAsync([FromRoute] int id, [FromBody] UpdateThemeDto request)
{
var theme = await ThemeRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (theme == null)
return Problem("No theme with this id found", statusCode: 404);
ThemeMapper.Merge(theme, request);
await ThemeRepository.UpdateAsync(theme);
await FrontendService.ResetCacheAsync();
return ThemeMapper.ToDto(theme);
}
[HttpDelete("{id:int}")]
[Authorize(Policy = Permissions.Themes.Delete)]
public async Task<ActionResult> DeleteAsync([FromRoute] int id)
{
var theme = await ThemeRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (theme == null)
return Problem("No theme with this id found", statusCode: 404);
await ThemeRepository.RemoveAsync(theme);
await FrontendService.ResetCacheAsync();
return NoContent();
}
}

View File

@@ -0,0 +1,76 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Mappers;
using Moonlight.Api.Models;
using Moonlight.Shared;
using Moonlight.Shared.Http.Responses.Admin.Themes;
using VYaml.Serialization;
namespace Moonlight.Api.Http.Controllers.Admin.Themes;
[ApiController]
[Route("api/admin/themes")]
[Authorize(Policy = Permissions.Themes.View)]
public class TransferController : Controller
{
private readonly DatabaseRepository<Theme> ThemeRepository;
public TransferController(DatabaseRepository<Theme> themeRepository)
{
ThemeRepository = themeRepository;
}
[HttpGet("{id:int}/export")]
public async Task<ActionResult> ExportAsync([FromRoute] int id)
{
var theme = await ThemeRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (theme == null)
return Problem("No theme with that id found", statusCode: 404);
var yml = YamlSerializer.Serialize(new ThemeTransferModel()
{
Name = theme.Name,
Author = theme.Author,
CssContent = theme.CssContent,
Version = theme.Version
});
return File(yml.ToArray(), "text/yaml", $"{theme.Name}.yml");
}
[HttpPost("import")]
public async Task<ActionResult<ThemeDto>> ImportAsync()
{
var themeToImport = await YamlSerializer.DeserializeAsync<ThemeTransferModel>(Request.Body);
var existingTheme = await ThemeRepository
.Query()
.FirstOrDefaultAsync(x => x.Name == themeToImport.Name && x.Author == themeToImport.Author);
if (existingTheme == null)
{
var finalTheme = await ThemeRepository.AddAsync(new Theme()
{
Name = themeToImport.Name,
Author = themeToImport.Author,
CssContent = themeToImport.CssContent,
Version = themeToImport.Version
});
return ThemeMapper.ToDto(finalTheme);
}
existingTheme.CssContent = themeToImport.CssContent;
existingTheme.Version = themeToImport.Version;
await ThemeRepository.UpdateAsync(existingTheme);
return ThemeMapper.ToDto(existingTheme);
}
}

View File

@@ -0,0 +1,56 @@
using System.Collections.Frozen;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Services;
using Moonlight.Shared;
namespace Moonlight.Api.Http.Controllers.Admin.Users;
[ApiController]
[Route("api/admin/users")]
[Authorize(Policy = Permissions.Users.Delete)]
public class UserDeletionController : Controller
{
private readonly UserDeletionService UserDeletionService;
private readonly DatabaseRepository<User> Repository;
public UserDeletionController(UserDeletionService userDeletionService, DatabaseRepository<User> repository)
{
UserDeletionService = userDeletionService;
Repository = repository;
}
[HttpDelete("{id:int}")]
public async Task<ActionResult> DeleteAsync([FromRoute] int id)
{
var userExists = await Repository
.Query()
.AnyAsync(user => user.Id == id);
if (!userExists)
return Problem("No user with this id found", statusCode: 404);
var validationResult = await UserDeletionService.ValidateAsync(id);
if (!validationResult.IsValid)
{
return ValidationProblem(
new ValidationProblemDetails(
new Dictionary<string, string[]>()
{
{
string.Empty,
validationResult.ErrorMessages.ToArray()
}
}
)
);
}
await UserDeletionService.DeleteAsync(id);
return NoContent();
}
}

View File

@@ -0,0 +1,41 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Services;
using Moonlight.Shared;
namespace Moonlight.Api.Http.Controllers.Admin.Users;
[ApiController]
[Route("api/admin/users/{id:int}/logout")]
[Authorize(Policy = Permissions.Users.Logout)]
public class UserLogoutController : Controller
{
private readonly UserLogoutService LogoutService;
private readonly DatabaseRepository<User> Repository;
public UserLogoutController(
UserLogoutService logoutService,
DatabaseRepository<User> repository
)
{
LogoutService = logoutService;
Repository = repository;
}
[HttpPost]
public async Task<ActionResult> LogoutAsync([FromRoute] int id)
{
var userExists = await Repository
.Query()
.AnyAsync(user => user.Id == id);
if (!userExists)
return Problem("No user with this id found", statusCode: 404);
await LogoutService.LogoutAsync(id);
return NoContent();
}
}

View File

@@ -0,0 +1,120 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Api.Mappers;
using Moonlight.Shared;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Requests.Admin.Users;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Http.Responses.Admin.Users;
namespace Moonlight.Api.Http.Controllers.Admin.Users;
[Authorize]
[ApiController]
[Route("api/admin/users")]
public class UsersController : Controller
{
private readonly DatabaseRepository<User> UserRepository;
public UsersController(DatabaseRepository<User> userRepository)
{
UserRepository = userRepository;
}
[HttpGet]
[Authorize(Policy = Permissions.Users.View)]
public async Task<ActionResult<PagedData<UserDto>>> GetAsync(
[FromQuery] int startIndex,
[FromQuery] int length,
[FromQuery] FilterOptions? filterOptions
)
{
// Validation
if (startIndex < 0)
return Problem("Invalid start index specified", statusCode: 400);
if (length is < 1 or > 100)
return Problem("Invalid length specified");
// Query building
var query = UserRepository
.Query();
// Filters
if (filterOptions != null)
{
foreach (var filterOption in filterOptions.Filters)
{
query = filterOption.Key switch
{
nameof(Database.Entities.User.Email) =>
query.Where(user => EF.Functions.ILike(user.Email, $"%{filterOption.Value}%")),
nameof(Database.Entities.User.Username) =>
query.Where(user => EF.Functions.ILike(user.Username, $"%{filterOption.Value}%")),
_ => query
};
}
}
// Pagination
var data = await query
.OrderBy(x => x.Id)
.ProjectToDto()
.Skip(startIndex)
.Take(length)
.ToArrayAsync();
var total = await query.CountAsync();
return new PagedData<UserDto>(data, total);
}
[HttpGet("{id:int}")]
[Authorize(Policy = Permissions.Users.View)]
public async Task<ActionResult<UserDto>> GetAsync([FromRoute] int id)
{
var user = await UserRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (user == null)
return Problem("No user with this id found", statusCode: 404);
return UserMapper.ToDto(user);
}
[HttpPost]
[Authorize(Policy = Permissions.Users.Create)]
public async Task<ActionResult<UserDto>> CreateAsync([FromBody] CreateUserDto request)
{
var user = UserMapper.ToEntity(request);
user.InvalidateTimestamp = DateTimeOffset.UtcNow.AddMinutes(-1);
var finalUser = await UserRepository.AddAsync(user);
return UserMapper.ToDto(finalUser);
}
[HttpPatch("{id:int}")]
[Authorize(Policy = Permissions.Users.Edit)]
public async Task<ActionResult<UserDto>> UpdateAsync([FromRoute] int id, [FromBody] UpdateUserDto request)
{
var user = await UserRepository
.Query()
.FirstOrDefaultAsync(x => x.Id == id);
if (user == null)
return Problem("No user with this id found", statusCode: 404);
UserMapper.Merge(user, request);
await UserRepository.UpdateAsync(user);
return UserMapper.ToDto(user);
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Moonlight.Api.Mappers;
using Moonlight.Api.Services;
using Moonlight.Shared;
using Moonlight.Shared.Http.Responses.Admin;
namespace Moonlight.Api.Http.Controllers.Admin;
[ApiController]
[Route("api/admin/versions")]
[Authorize(Policy = Permissions.System.Versions)]
public class VersionsController : Controller
{
private readonly VersionService VersionService;
public VersionsController(VersionService versionService)
{
VersionService = versionService;
}
[HttpGet]
public async Task<ActionResult<VersionDto[]>> GetAsync()
{
var versions = await VersionService.GetVersionsAsync();
return VersionMapper.ToDtos(versions).ToArray();
}
[HttpGet("instance")]
public async Task<ActionResult<VersionDto>> GetInstanceAsync()
{
var version = await VersionService.GetInstanceVersionAsync();
return VersionMapper.ToDto(version);
}
[HttpGet("latest")]
public async Task<ActionResult<VersionDto>> GetLatestAsync()
{
var version = await VersionService.GetLatestVersionAsync();
if(version == null)
return Problem("Unable to retrieve latest version", statusCode: 404);
return VersionMapper.ToDto(version);
}
}

View File

@@ -0,0 +1,65 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Moonlight.Shared.Http.Responses.Admin.Auth;
namespace Moonlight.Api.Http.Controllers;
[ApiController]
[Route("api/auth")]
public class AuthController : Controller
{
private readonly IAuthenticationSchemeProvider SchemeProvider;
public AuthController(IAuthenticationSchemeProvider schemeProvider)
{
SchemeProvider = schemeProvider;
}
[HttpGet]
public async Task<ActionResult<SchemeDto[]>> GetSchemesAsync()
{
var schemes = await SchemeProvider.GetAllSchemesAsync();
return schemes
.Where(scheme => !string.IsNullOrWhiteSpace(scheme.DisplayName))
.Select(scheme => new SchemeDto(scheme.Name, scheme.DisplayName!))
.ToArray();
}
[HttpGet("{schemeName:alpha}")]
public async Task<ActionResult> StartAsync([FromRoute] string schemeName)
{
var scheme = await SchemeProvider.GetSchemeAsync(schemeName);
if (scheme == null || string.IsNullOrWhiteSpace(scheme.DisplayName))
return Problem("Invalid authentication scheme name", statusCode: 400);
return Challenge(new AuthenticationProperties()
{
RedirectUri = "/"
}, scheme.Name);
}
[Authorize]
[HttpGet("claims")]
public Task<ActionResult<ClaimDto[]>> GetClaimsAsync()
{
var result = User.Claims
.Select(claim => new ClaimDto(claim.Type, claim.Value))
.ToArray();
return Task.FromResult<ActionResult<ClaimDto[]>>(result);
}
[HttpGet("logout")]
public Task<ActionResult> LogoutAsync()
{
return Task.FromResult<ActionResult>(
SignOut(new AuthenticationProperties()
{
RedirectUri = "/"
})
);
}
}

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
using Moonlight.Api.Mappers;
using Moonlight.Api.Services;
using Moonlight.Shared.Http.Responses.Admin.Frontend;
namespace Moonlight.Api.Http.Controllers;
[ApiController]
[Route("api/frontend")]
public class FrontendController : Controller
{
private readonly FrontendService FrontendService;
public FrontendController(FrontendService frontendService)
{
FrontendService = frontendService;
}
[HttpGet("config")]
public async Task<ActionResult<FrontendConfigDto>> GetConfigAsync()
{
var configuration = await FrontendService.GetConfigurationAsync();
return FrontendConfigMapper.ToDto(configuration);
}
}

View File

@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Moonlight.Api.Http.Controllers;
[ApiController]
[Route("api/ping")]
public class PingController : Controller
{
[HttpGet]
[AllowAnonymous]
public IActionResult Get() => Ok("Pong");
}

View File

@@ -0,0 +1,20 @@
using System.Text.Json.Serialization;
namespace Moonlight.Api.Http.Services.ContainerHelper.Events;
public struct RebuildEventDto
{
[JsonPropertyName("type")]
public RebuildEventType Type { get; set; }
[JsonPropertyName("data")]
public string Data { get; set; }
}
public enum RebuildEventType
{
Log = 0,
Failed = 1,
Succeeded = 2,
Step = 3
}

View File

@@ -0,0 +1,10 @@
namespace Moonlight.Api.Http.Services.ContainerHelper;
public class ProblemDetails
{
public string Type { get; set; }
public string Title { get; set; }
public int Status { get; set; }
public string? Detail { get; set; }
public Dictionary<string, string[]>? Errors { get; set; }
}

View File

@@ -0,0 +1,3 @@
namespace Moonlight.Api.Http.Services.ContainerHelper.Requests;
public record RequestRebuildDto(bool NoBuildCache);

View File

@@ -0,0 +1,3 @@
namespace Moonlight.Api.Http.Services.ContainerHelper.Requests;
public record SetVersionDto(string Version);

View File

@@ -0,0 +1,17 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Moonlight.Api.Http.Services.ContainerHelper.Events;
using Moonlight.Api.Http.Services.ContainerHelper.Requests;
namespace Moonlight.Api.Http.Services.ContainerHelper;
[JsonSerializable(typeof(SetVersionDto))]
[JsonSerializable(typeof(ProblemDetails))]
[JsonSerializable(typeof(RebuildEventDto))]
[JsonSerializable(typeof(RequestRebuildDto))]
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web)]
public partial class SerializationContext : JsonSerializerContext
{
}

View File

@@ -0,0 +1,79 @@
using System.Security.Claims;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Authentication;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Hybrid;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Moonlight.Api.Database;
using Moonlight.Api.Database.Entities;
using Moonlight.Shared;
namespace Moonlight.Api.Implementations.ApiKeyScheme;
public class ApiKeySchemeHandler : AuthenticationHandler<ApiKeySchemeOptions>
{
private readonly DatabaseRepository<ApiKey> ApiKeyRepository;
private readonly HybridCache HybridCache;
public const string CacheKeyFormat = $"Moonlight.Api.{nameof(ApiKeySchemeHandler)}.{{0}}";
public ApiKeySchemeHandler(
IOptionsMonitor<ApiKeySchemeOptions> options,
ILoggerFactory logger,
UrlEncoder encoder,
DatabaseRepository<ApiKey> apiKeyRepository,
HybridCache hybridCache
) : base(options, logger, encoder)
{
ApiKeyRepository = apiKeyRepository;
HybridCache = hybridCache;
}
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
{
var authHeaderValue = Request.Headers.Authorization.FirstOrDefault() ?? null;
if (string.IsNullOrWhiteSpace(authHeaderValue))
return AuthenticateResult.NoResult();
if (authHeaderValue.Length > 32)
return AuthenticateResult.Fail("Invalid api key specified");
var cacheKey = string.Format(CacheKeyFormat, authHeaderValue);
var apiKey = await HybridCache.GetOrCreateAsync<ApiKeySession?>(
cacheKey,
async ct =>
{
return await ApiKeyRepository
.Query()
.Where(x => x.Key == authHeaderValue)
.Select(x => new ApiKeySession(x.Permissions, x.ValidUntil))
.FirstOrDefaultAsync(cancellationToken: ct);
},
new HybridCacheEntryOptions()
{
LocalCacheExpiration = Options.LookupL1CacheTime,
Expiration = Options.LookupL2CacheTime
}
);
if (apiKey == null)
return AuthenticateResult.Fail("Invalid api key specified");
if (DateTimeOffset.UtcNow > apiKey.ValidUntil)
return AuthenticateResult.Fail("Api key expired");
return AuthenticateResult.Success(new AuthenticationTicket(
new ClaimsPrincipal(
new ClaimsIdentity(
apiKey.Permissions.Select(x => new Claim(Permissions.ClaimType, x)).ToArray()
)
),
Scheme.Name
));
}
private record ApiKeySession(string[] Permissions, DateTimeOffset ValidUntil);
}

View File

@@ -0,0 +1,9 @@
using Microsoft.AspNetCore.Authentication;
namespace Moonlight.Api.Implementations.ApiKeyScheme;
public class ApiKeySchemeOptions : AuthenticationSchemeOptions
{
public TimeSpan LookupL1CacheTime { get; set; }
public TimeSpan LookupL2CacheTime { get; set; }
}

View File

@@ -0,0 +1,29 @@
using Microsoft.AspNetCore.Authorization;
using Moonlight.Shared;
namespace Moonlight.Api.Implementations;
public class PermissionAuthorizationHandler : AuthorizationHandler<PermissionRequirement>
{
protected override Task HandleRequirementAsync(
AuthorizationHandlerContext context,
PermissionRequirement requirement)
{
var permissionClaim = context.User.FindFirst(x =>
x.Type.Equals(Permissions.ClaimType, StringComparison.OrdinalIgnoreCase) &&
x.Value.Equals(requirement.Identifier, StringComparison.OrdinalIgnoreCase)
);
if (permissionClaim == null)
{
context.Fail(new AuthorizationFailureReason(
this,
$"User does not have the requested permission '{requirement.Identifier}'"
));
return Task.CompletedTask;
}
context.Succeed(requirement);
return Task.CompletedTask;
}
}

View File

@@ -0,0 +1,42 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options;
using Moonlight.Shared;
namespace Moonlight.Api.Implementations;
public class PermissionPolicyProvider : IAuthorizationPolicyProvider
{
private readonly DefaultAuthorizationPolicyProvider FallbackProvider;
public PermissionPolicyProvider(IOptions<AuthorizationOptions> options)
{
FallbackProvider = new DefaultAuthorizationPolicyProvider(options);
}
public async Task<AuthorizationPolicy?> GetPolicyAsync(string policyName)
{
if (!policyName.StartsWith(Permissions.Prefix, StringComparison.OrdinalIgnoreCase))
return await FallbackProvider.GetPolicyAsync(policyName);
var policy = new AuthorizationPolicyBuilder();
policy.AddRequirements(new PermissionRequirement(policyName));
return policy.Build();
}
public Task<AuthorizationPolicy> GetDefaultPolicyAsync()
=> FallbackProvider.GetDefaultPolicyAsync();
public Task<AuthorizationPolicy?> GetFallbackPolicyAsync()
=> FallbackProvider.GetFallbackPolicyAsync();
}
public class PermissionRequirement : IAuthorizationRequirement
{
public string Identifier { get; }
public PermissionRequirement(string identifier)
{
Identifier = identifier;
}
}

View File

@@ -0,0 +1,33 @@
using Moonlight.Api.Interfaces;
using Moonlight.Api.Models;
using Moonlight.Api.Services;
namespace Moonlight.Api.Implementations;
public sealed class UpdateDiagnoseProvider : IDiagnoseProvider
{
private readonly ApplicationService ApplicationService;
public UpdateDiagnoseProvider(ApplicationService applicationService)
{
ApplicationService = applicationService;
}
public Task<DiagnoseResult[]> DiagnoseAsync()
{
if (ApplicationService.IsUpToDate)
return Task.FromResult<DiagnoseResult[]>([]);
return Task.FromResult<DiagnoseResult[]>([
new DiagnoseResult(
DiagnoseLevel.Warning,
"Instance is not up-to-date",
["Moonlight", "Update Check"],
"Update your moonlight instance to receive bug fixes, new features and security patches. Update button can be found in the overview",
null,
"/admin",
null
)
]);
}
}

View File

@@ -0,0 +1,8 @@
using Moonlight.Api.Models;
namespace Moonlight.Api.Interfaces;
public interface IDiagnoseProvider
{
public Task<DiagnoseResult[]> DiagnoseAsync();
}

View File

@@ -0,0 +1,13 @@
using System.Security.Claims;
using Moonlight.Api.Database.Entities;
namespace Moonlight.Api.Interfaces;
public interface IUserAuthHook
{
public Task<bool> SyncAsync(ClaimsPrincipal principal, User trackedUser);
// Every implementation of this function should execute as fast as possible
// as this directly impacts every api call
public Task<bool> ValidateAsync(ClaimsPrincipal principal, int userId);
}

View File

@@ -0,0 +1,9 @@
using Moonlight.Api.Database.Entities;
namespace Moonlight.Api.Interfaces;
public interface IUserDeletionHook
{
public Task<bool> ValidateAsync(User user, List<string> errors);
public Task ExecuteAsync(User user);
}

View File

@@ -0,0 +1,8 @@
using Moonlight.Api.Database.Entities;
namespace Moonlight.Api.Interfaces;
public interface IUserLogoutHook
{
public Task ExecuteAsync(User user);
}

View File

@@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
using Moonlight.Api.Database.Entities;
using Moonlight.Shared.Http.Requests.Admin.ApiKeys;
using Moonlight.Shared.Http.Responses.Admin.ApiKeys;
using Riok.Mapperly.Abstractions;
namespace Moonlight.Api.Mappers;
[Mapper]
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
public static partial class ApiKeyMapper
{
public static partial IQueryable<ApiKeyDto> ProjectToDto(this IQueryable<ApiKey> apiKeys);
public static partial ApiKeyDto ToDto(ApiKey apiKey);
public static partial void Merge([MappingTarget] ApiKey apiKey, UpdateApiKeyDto request);
public static partial ApiKey ToEntity(CreateApiKeyDto request);
}

View File

@@ -0,0 +1,13 @@
using System.Diagnostics.CodeAnalysis;
using Moonlight.Shared.Http.Events;
using Riok.Mapperly.Abstractions;
namespace Moonlight.Api.Mappers;
[Mapper]
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
public static partial class ContainerHelperMapper
{
public static partial RebuildEventDto ToDto(Http.Services.ContainerHelper.Events.RebuildEventDto rebuildEventDto);
}

View File

@@ -0,0 +1,14 @@
using System.Diagnostics.CodeAnalysis;
using Moonlight.Api.Models;
using Moonlight.Shared.Http.Responses.Admin;
using Riok.Mapperly.Abstractions;
namespace Moonlight.Api.Mappers;
[Mapper]
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
public static partial class DiagnoseResultMapper
{
public static partial IEnumerable<DiagnoseResultDto> ToDto(this IEnumerable<DiagnoseResult> results);
}

View File

@@ -0,0 +1,14 @@
using System.Diagnostics.CodeAnalysis;
using Moonlight.Api.Models;
using Moonlight.Shared.Http.Responses.Admin.Frontend;
using Riok.Mapperly.Abstractions;
namespace Moonlight.Api.Mappers;
[Mapper]
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
public static partial class FrontendConfigMapper
{
public static partial FrontendConfigDto ToDto(FrontendConfiguration configuration);
}

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