Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
73bf27d
Removed old architecture. Added new base project structure
Masu-Baumgartner Sep 30, 2024
fa74849
Small changes
Masu-Baumgartner Sep 30, 2024
ef2e6c9
Added login/register function. Implemented authentication. Started au…
Masu-Baumgartner Oct 1, 2024
e32e35d
Implemented api/check endpoint. Added api error middleware
Masu-Baumgartner Oct 1, 2024
ca1b7a8
Merge branch 'v2_ChangeArchitecture' of https://github.com/Moonlight-…
Masu-Baumgartner Oct 1, 2024
522d0c1
Added app loaders and screen for the ui. Added identity service. Star…
Masu-Baumgartner Oct 1, 2024
a0432ee
Improved PWA options. Fully implemented auth
Masu-Baumgartner Oct 2, 2024
966e67a
Adjusted header to use identity service values
Masu-Baumgartner Oct 4, 2024
cf25e4e
Implemented admin users crud api
Masu-Baumgartner Oct 5, 2024
f48e5d4
Implemented admin crud ui for users page. Fixed some smaller issues
Masu-Baumgartner Oct 6, 2024
bb29177
Merge branch 'v2_ChangeArchitecture' of https://github.com/Moonlight-…
Masu-Baumgartner Oct 7, 2024
19afc5d
Added permissions to users controller and the client.
Masu-Baumgartner Oct 7, 2024
13daa3c
Started testing tag component
Masu-Baumgartner Oct 9, 2024
9d13515
Started implementing oauth2 based on MoonCore helper services
Masu-Baumgartner Oct 17, 2024
6be3b83
Improved token handling and used new validate auth request for oauth2
Masu-Baumgartner Oct 18, 2024
8883b52
Started implementing client and api server auth and the refresh endpoint
Masu-Baumgartner Oct 19, 2024
71dc81c
Reorganized config. Re implemented auth controller to use token-pair …
Masu-Baumgartner Oct 19, 2024
f166de1
Implemented complete oauth2 flow with modular providers
Masu-Baumgartner Oct 19, 2024
c4c3d1b
Implemented better ux for the oauth2 workflow
Masu-Baumgartner Oct 19, 2024
910f190
Completed first iteration of access-refresh auth. Upgraded mooncore. …
Masu-Baumgartner Oct 21, 2024
6f3341e
Switched to LocalStorage. Upgraded MoonCore. Improved auth flow
Masu-Baumgartner Oct 23, 2024
eba6e00
Improved oauth2 ui design
Masu-Baumgartner Oct 25, 2024
7239182
Changed colors......
Masu-Baumgartner Oct 25, 2024
c15f181
Changed auth success ui. Switched to new interface service. Upgraded …
Masu-Baumgartner Oct 27, 2024
f6ed12f
Upgraded MoonCore packages. Small ui improvement
Masu-Baumgartner Oct 28, 2024
e02af77
Cleaned up the startup sequence.
Masu-Baumgartner Oct 28, 2024
54e0675
Improved default log level definition
Masu-Baumgartner Oct 29, 2024
e5f29e4
Added fancy start page greeting
Masu-Baumgartner Oct 29, 2024
324bf68
Implemented api key crud and started adding system page. Added 404 page
Masu-Baumgartner Oct 29, 2024
6d0c75c
Smaller ui adjustments
Masu-Baumgartner Oct 29, 2024
fce44f4
Implemented apikey backend
Masu-Baumgartner Oct 30, 2024
b0a044d
Implemented apex charts for visualisation
Masu-Baumgartner Oct 30, 2024
b73c3eb
Started with docker compose config. Switched to new config system. Up…
Masu-Baumgartner Nov 3, 2024
17a4e7e
Added option to disable the client hosting of the api server
Masu-Baumgartner Nov 3, 2024
81d8bc4
Improved caching to exclude server side only resources
Masu-Baumgartner Nov 3, 2024
06f7731
Implemented register functionality
Masu-Baumgartner Nov 3, 2024
399fbba
Started testing a dx friendlier oauth2 handler
Masu-Baumgartner Nov 4, 2024
69e5e1c
Removed unused file. Fixed typo
Masu-Baumgartner Nov 5, 2024
288b0c8
Started testing oauth2 handler from mooncore
Masu-Baumgartner Nov 5, 2024
f2d6535
Adjusting to use new extension methods to configure and handle token …
Masu-Baumgartner Nov 6, 2024
f9c4ec1
Completed adjustments for the new configuration of oauth2 and token auth
Masu-Baumgartner Nov 6, 2024
add4c3e
Fixed smaller issues with refreshing the access token on frontend side
Masu-Baumgartner Nov 6, 2024
764ebe3
Implemented system overview
Masu-Baumgartner Nov 8, 2024
1881076
DevServer things :>
Masu-Baumgartner Nov 8, 2024
96bb3a5
Preparations for plugin/module development
Masu-Baumgartner Nov 10, 2024
d92f996
Started adding module service
Masu-Baumgartner Nov 10, 2024
a074f0c
Testing new oauth2 setup
Masu-Baumgartner Nov 11, 2024
e5555c8
Cleanud up auth code
Masu-Baumgartner Nov 12, 2024
072adb5
Working on module/plugin system
Masu-Baumgartner Nov 14, 2024
2d0a0e5
Implementing plugin loading for api server and client
Masu-Baumgartner Nov 19, 2024
fe31c01
Upgraded packages. Improved startup. Removed unused components
Masu-Baumgartner Nov 20, 2024
f702167
Fixed api exception handler
Masu-Baumgartner Nov 21, 2024
23a74bd
Fixed plugin loader usage. Improved export for nuget. Changed css name
Masu-Baumgartner Nov 21, 2024
bc737c8
Started adding asset api/auto import
Masu-Baumgartner Nov 26, 2024
2e98d16
Changed icons to use Lucide icons
ChiaraBm Dec 1, 2024
0a76e64
Added AssetService. Added command line handling for assets. Added ass…
ChiaraBm Dec 1, 2024
62fe608
Improved asset service. Removed now unused plugin asset streaming end…
ChiaraBm Dec 1, 2024
7215709
Automated nuget package build
ChiaraBm Dec 1, 2024
f08c8f0
Upgraded dependencies
ChiaraBm Dec 5, 2024
64b20e2
Created a nuget build script for developers using windows
ChiaraBm Dec 5, 2024
150a18c
Implemented css bundling
ChiaraBm Dec 10, 2024
75cefea
Implemented download service
ChiaraBm Dec 10, 2024
e63a3db
Added css bundle api. Improved css bundling code
ChiaraBm Dec 10, 2024
e6c9fee
Fixed bundle generation service
ChiaraBm Dec 10, 2024
42ab052
Added helper script
ChiaraBm Dec 10, 2024
5efeb5f
Created powershell variant of the nuget cache helper script
ChiaraBm Dec 11, 2024
094af84
Added app startup for the frontend
ChiaraBm Dec 13, 2024
143ba3c
Fixed app startup issue in frontend for dev server
ChiaraBm Dec 13, 2024
b95f896
Updated mooncore tailwind dependency
ChiaraBm Dec 17, 2024
744d977
Upgraded frontend dependencies
ChiaraBm Dec 20, 2024
bf89ef1
Upgraded MoonCore
ChiaraBm Dec 20, 2024
d477e80
Upgraded mooncore packages. Added css variables for theming. Made all…
ChiaraBm Jan 4, 2025
8372cfa
Started implementing fronted configuration. Upgraded mooncore. Made d…
ChiaraBm Jan 6, 2025
e299cde
Removed asset controllers. Started adding design section in settings
ChiaraBm Jan 6, 2025
1a4864b
Added theming support. Added import/export
ChiaraBm Jan 7, 2025
bf5a744
Starting updating mooncore dependency usage
ChiaraBm Feb 4, 2025
b6b488e
Updated mooncore dependency usage
ChiaraBm Feb 5, 2025
2e5d0dc
Added new mooncore js dependencies. Added ace editor build
ChiaraBm Feb 5, 2025
480d118
Implemented system files tab
ChiaraBm Feb 6, 2025
fa86b26
Upgraded npm package. Made update view paths shorter
ChiaraBm Feb 8, 2025
4a571e1
Updated theme
ChiaraBm Feb 17, 2025
69df761
Implemented plugin interface loading via di
ChiaraBm Feb 24, 2025
3dd5d29
Implemented plugin loading via di on the api server. Fixed plugin loa…
ChiaraBm Feb 24, 2025
a23c3b0
Added comments
ChiaraBm Feb 24, 2025
64f4a3a
Started migrating to postgresql
ChiaraBm Feb 25, 2025
f4a0aab
Finished migration to postgresql. Updated mooncore package
ChiaraBm Feb 26, 2025
cdc4744
Added theme saving. Added interfaces for overview pages. Renamed side…
ChiaraBm Feb 26, 2025
caa8d47
Simplified plugin service and loading
ChiaraBm Feb 26, 2025
6c5e4c2
Fixed bundling. Upgraded mooncore.extended
ChiaraBm Feb 26, 2025
b109298
Updated mooncore versions. Removed unused imports and legacy configur…
ChiaraBm Feb 28, 2025
45ccb6f
Fixed oauth2 configuration loading
ChiaraBm Feb 28, 2025
1f95577
Updated mooncore.extended. Adjusted authentication config to support …
ChiaraBm Mar 1, 2025
9fb1667
Updated mooncore dependencies
ChiaraBm Mar 6, 2025
f23320e
Added max file size upload option. Switched from stream upload to mul…
ChiaraBm Mar 7, 2025
340cf73
Updated mooncore dependencies. Improved ux for the system file manager
ChiaraBm Mar 13, 2025
f1c0d3b
Implemented api authentication. Removed old secret system
ChiaraBm Mar 14, 2025
3084bb2
Implemented proper mobile sidebar. Fixed mobile view of api key page.…
ChiaraBm Mar 14, 2025
1238095
Moved resources. Added placeholder pfp
ChiaraBm Mar 14, 2025
75f037d
Implemented frontend hosting file generation helper
ChiaraBm Mar 16, 2025
420ff46
Improved upload progress tracking. Fixed path on frontend export
ChiaraBm Mar 17, 2025
55a8cfa
Implemented chunked uploading. Updated mooncore
ChiaraBm Mar 20, 2025
a9d3a30
Fixed overwriting issue for chunked file upload
ChiaraBm Mar 20, 2025
f1adba4
Updated to latest mooncore version
ChiaraBm Mar 24, 2025
3f511ce
Updated loader style so the table loader is working again
ChiaraBm Mar 24, 2025
e1c0722
Updated sidebar and header
ChiaraBm Mar 30, 2025
7fa46ef
Removed use of crud helper. Refactored user and api key response. Rem…
ChiaraBm Apr 5, 2025
55bc825
Added hangfire. Implemented hangfire statistics. Updated lucide icons
ChiaraBm Apr 9, 2025
b0fe27c
Removed left over rider files
ChiaraBm Apr 14, 2025
f56f592
Added distroless dockerfile. Updated docker compose
ChiaraBm Apr 14, 2025
0b0c930
Added oauth2 access endpoint override option
ChiaraBm Apr 14, 2025
db7ac8d
Removed unused middleware. Fixed plugin loading issues
ChiaraBm Apr 15, 2025
c12e1e3
Implemented user permission update
ChiaraBm Apr 15, 2025
f81b84e
Cleaned up swagger controller
ChiaraBm Apr 15, 2025
504cb8e
Implemented modular oauth2 system
ChiaraBm Apr 15, 2025
7defc9a
Removed legacy and testing options from compose
ChiaraBm Apr 15, 2025
65ea598
Implement disabling of local oauth2 controller
ChiaraBm Apr 15, 2025
6657bae
Improved api key ux
ChiaraBm Apr 15, 2025
bbc6c0f
Upgraded to latest mooncore packages. Upgraded to tailwind v4
ChiaraBm May 2, 2025
1a67fcf
Added nuget export options for development. Added nuget patch script …
ChiaraBm May 8, 2025
1b4d32e
Prepared tailwind system for plugin builds and exports via nuget. Rem…
ChiaraBm May 10, 2025
8126250
Implemented tag based run helper script
ChiaraBm May 11, 2025
a579dd4
Finished compile time plugin loading. Refactored plugin loading. Exte…
ChiaraBm May 13, 2025
73ca5e5
Added nuget directory option to pack command of the script
ChiaraBm May 13, 2025
6922242
Disabled generation of packages during build. Re-enabled trimming in …
ChiaraBm May 13, 2025
0e5402c
Removed unused calls and classes from the old plugin system
ChiaraBm May 14, 2025
3a804c9
Upgraded to dotnet 9
ChiaraBm May 15, 2025
9dc77e6
Workaround for https://github.com/dotnet/aspnetcore/issues/59291
ChiaraBm May 15, 2025
7ead76f
Implemented First User Admin Feature
mxritzdev May 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/storage
**/compose.yml
LICENSE
README.md
README.md

# For the people who run moonlight inside the main repo with the relative data path
data
39 changes: 35 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,39 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Moonlight
storage/
.idea/.idea.Moonlight/.idea/dataSources.xml
Moonlight/Assets/Core/css/theme.css
Moonlight/Assets/Core/css/theme.css.map
.idea/.idea.Moonlight/.idea/discord.xml
**/.idea/**
style.min.css
core.min.css

# Build script for nuget packages
finalPackages/
nupkgs/

# Scripts
**/bin/**
**/obj/**
13 changes: 0 additions & 13 deletions .idea/.idea.Moonlight/.idea/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/.idea.Moonlight/.idea/discord.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/.idea.Moonlight/.idea/encodings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.idea.Moonlight/.idea/indexLayout.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/.idea.Moonlight/.idea/material_theme_project_new.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.Moonlight/.idea/vcs.xml

This file was deleted.

62 changes: 62 additions & 0 deletions Moonlight.ApiServer/Configuration/AppConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using MoonCore.Helpers;

namespace Moonlight.ApiServer.Configuration;

public class AppConfiguration
{
public string PublicUrl { get; set; } = "http://localhost:5165";

public DatabaseConfig Database { get; set; } = new();
public AuthenticationConfig Authentication { get; set; } = new();
public DevelopmentConfig Development { get; set; } = new();
public ClientConfig Client { get; set; } = new();
public KestrelConfig Kestrel { get; set; } = new();

public class ClientConfig
{
public bool Enable { get; set; } = true;
}

public class DatabaseConfig
{
public string Host { get; set; } = "your-database-host.name";
public int Port { get; set; } = 5432;

public string Username { get; set; } = "db_user";
public string Password { get; set; } = "db_password";

public string Database { get; set; } = "db_name";
}

public class AuthenticationConfig
{
public string Secret { get; set; } = Formatter.GenerateString(32);
public int TokenDuration { get; set; } = 24 * 10;

public bool EnableLocalOAuth2 { get; set; } = true;
public OAuth2Data OAuth2 { get; set; } = new();

public class OAuth2Data
{
public string Secret { get; set; } = Formatter.GenerateString(32);
public string ClientId { get; set; } = Formatter.GenerateString(8);
public string ClientSecret { get; set; } = Formatter.GenerateString(32);
public string? AuthorizationEndpoint { get; set; }
public string? AccessEndpoint { get; set; }
public string? AuthorizationRedirect { get; set; }

public bool FirstUserAdmin { get; set; } = true;
}
}

public class DevelopmentConfig
{
public bool EnableApiDocs { get; set; } = false;
}

public class KestrelConfig
{
public int UploadLimit { get; set; } = 100;
public string AllowedOrigins { get; set; } = "*";
}
}
33 changes: 33 additions & 0 deletions Moonlight.ApiServer/Database/CoreDataContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Hangfire.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using MoonCore.Extended.SingleDb;
using Moonlight.ApiServer.Configuration;
using Moonlight.ApiServer.Database.Entities;

namespace Moonlight.ApiServer.Database;

public class CoreDataContext : DatabaseContext
{
public override string Prefix { get; } = "Core";

public DbSet<User> Users { get; set; }
public DbSet<ApiKey> ApiKeys { get; set; }

public CoreDataContext(AppConfiguration configuration)
{
Options = new()
{
Host = configuration.Database.Host,
Port = configuration.Database.Port,
Username = configuration.Database.Username,
Password = configuration.Database.Password,
Database = configuration.Database.Database
};
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.OnHangfireModelCreating();
}
}
19 changes: 19 additions & 0 deletions Moonlight.ApiServer/Database/Entities/ApiKey.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Moonlight.ApiServer.Database.Entities;

public class ApiKey
{
public int Id { get; set; }

public string Description { get; set; }

[Column(TypeName="jsonb")]
public string PermissionsJson { get; set; } = "[]";

[Column(TypeName = "timestamp with time zone")]
public DateTime ExpiresAt { get; set; }

[Column(TypeName = "timestamp with time zone")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
18 changes: 18 additions & 0 deletions Moonlight.ApiServer/Database/Entities/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Moonlight.ApiServer.Database.Entities;

public class User
{
public int Id { get; set; }

public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }

[Column(TypeName="timestamp with time zone")]
public DateTime TokenValidTimestamp { get; set; } = DateTime.MinValue;

[Column(TypeName="jsonb")]
public string PermissionsJson { get; set; } = "[]";
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading