mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Final polishing steps
This commit is contained in:
@@ -35,3 +35,4 @@ build/
|
|||||||
|
|
||||||
### Custom ###
|
### Custom ###
|
||||||
/data/
|
/data/
|
||||||
|
/backend/src/main/resources/static/
|
||||||
|
|||||||
+25
-17
@@ -10,7 +10,9 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>backend</artifactId>
|
<artifactId>gameyfin-backend</artifactId>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>18</java.version>
|
<java.version>18</java.version>
|
||||||
@@ -23,6 +25,14 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Frontend -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.grimsi</groupId>
|
||||||
|
<artifactId>gameyfin-frontend</artifactId>
|
||||||
|
<version>${project.parent.version}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Boot -->
|
<!-- Spring Boot -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -133,9 +143,11 @@
|
|||||||
<include>**/*.js</include>
|
<include>**/*.js</include>
|
||||||
<include>**/*.css</include>
|
<include>**/*.css</include>
|
||||||
<include>**/*.html</include>
|
<include>**/*.html</include>
|
||||||
|
<include>**/*.ico</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -151,30 +163,26 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Import the compiled frontend -->
|
<!-- Import the compiled frontend -->
|
||||||
<!--<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>merge</id>
|
<id>copy-resources</id>
|
||||||
<phase>initialize</phase>
|
<phase>validate</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>unpack</goal>
|
<goal>copy-resources</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<artifactItems>
|
<outputDirectory>${basedir}/src/main/resources/static</outputDirectory>
|
||||||
<artifactItem>
|
<resources>
|
||||||
<groupId>de.grimsi.gameyfin</groupId>
|
<resource>
|
||||||
<artifactId>frontend</artifactId>
|
<directory>${project.parent.basedir}/frontend/dist/frontend/</directory>
|
||||||
<version>${gameyfin-frontend.version}</version>
|
</resource>
|
||||||
<overWrite>true</overWrite>
|
</resources>
|
||||||
<outputDirectory>${project.build.directory}/classes/static</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
</artifactItems>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>-->
|
</plugin>
|
||||||
|
|
||||||
<!-- Protobuf source generation plugin -->
|
<!-- Protobuf source generation plugin -->
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package de.grimsi.gameyfin.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.lang.NonNull;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
import org.springframework.web.servlet.resource.PathResourceResolver;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class FrontendConfig implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
registry.addResourceHandler("/**")
|
||||||
|
.addResourceLocations("classpath:/static/")
|
||||||
|
.resourceChain(true)
|
||||||
|
.addResolver(new PathResourceResolver() {
|
||||||
|
@Override
|
||||||
|
protected Resource getResource(@NonNull String resourcePath, @NonNull Resource location) throws IOException {
|
||||||
|
Resource requestedResource = location.createRelative(resourcePath);
|
||||||
|
return requestedResource.exists() && requestedResource.isReadable() ? requestedResource : new ClassPathResource("/static/index.html");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.core.userdetails.User;
|
import org.springframework.security.core.userdetails.User;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.HttpStatusEntryPoint;
|
import org.springframework.security.web.authentication.HttpStatusEntryPoint;
|
||||||
@@ -40,9 +42,9 @@ public class SecurityConfiguration {
|
|||||||
@Bean
|
@Bean
|
||||||
public InMemoryUserDetailsManager userDetailsService() {
|
public InMemoryUserDetailsManager userDetailsService() {
|
||||||
UserDetails user = User
|
UserDetails user = User
|
||||||
.withDefaultPasswordEncoder()
|
.builder()
|
||||||
.username(username)
|
.username(username)
|
||||||
.password(password)
|
.password("{noop}" + password) // FIXME: not very secure
|
||||||
.authorities("ADMIN_API_ACCESS")
|
.authorities("ADMIN_API_ACCESS")
|
||||||
.build();
|
.build();
|
||||||
return new InMemoryUserDetailsManager(user);
|
return new InMemoryUserDetailsManager(user);
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ gameyfin.password=
|
|||||||
# Root folder of your game library
|
# Root folder of your game library
|
||||||
gameyfin.root=
|
gameyfin.root=
|
||||||
# Folders where gameyfin will store cached images and the database
|
# Folders where gameyfin will store cached images and the database
|
||||||
gameyfin.cache=${gameyfin.root}\.gameyfin\cache
|
gameyfin.cache=${gameyfin.root}/.gameyfin/cache
|
||||||
gameyfin.db=${gameyfin.root}\.gameyfin\db
|
gameyfin.db=${gameyfin.root}/.gameyfin/db
|
||||||
|
|
||||||
# File extensions which gameyfin will recognize as game files
|
# File extensions which gameyfin will recognize as game files
|
||||||
gameyfin.file-extensions=iso, zip, rar, 7z, exe
|
gameyfin.file-extensions=iso, zip, rar, 7z, exe
|
||||||
|
|||||||
+3
-3
@@ -9,7 +9,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>frontend</artifactId>
|
<artifactId>gameyfin-frontend</artifactId>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<!-- we copy the content of the frontend directory in the final artifact -->
|
<directory>./dist/frontend</directory>
|
||||||
<directory>dist/frontend</directory>
|
<targetPath>static</targetPath>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
<span class="spacer"></span>
|
<span class="spacer"></span>
|
||||||
|
|
||||||
<button mat-icon-button matTooltip="Toggle dark mode" (click)="toggleTheme()">
|
|
||||||
<mat-icon>brightness_medium</mat-icon>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button mat-icon-button matTooltip="Reload library" (click)="reloadLibrary()" *ngIf="onLibraryScreen()">
|
<button mat-icon-button matTooltip="Reload library" (click)="reloadLibrary()" *ngIf="onLibraryScreen()">
|
||||||
<mat-icon>refresh</mat-icon>
|
<mat-icon>refresh</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button mat-icon-button matTooltip="Toggle dark mode" (click)="toggleTheme()">
|
||||||
|
<mat-icon>brightness_medium</mat-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
<button mat-icon-button matTooltip="Scan library" (click)="scanLibrary()" *ngIf="onLibraryManagementScreen()">
|
<button mat-icon-button matTooltip="Scan library" (click)="scanLibrary()" *ngIf="onLibraryManagementScreen()">
|
||||||
<mat-icon>youtube_searched_for</mat-icon>
|
<mat-icon>youtube_searched_for</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user