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 ###
|
||||
/data/
|
||||
/backend/src/main/resources/static/
|
||||
|
||||
+25
-17
@@ -10,7 +10,9 @@
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>backend</artifactId>
|
||||
<artifactId>gameyfin-backend</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>18</java.version>
|
||||
@@ -23,6 +25,14 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Frontend -->
|
||||
<dependency>
|
||||
<groupId>de.grimsi</groupId>
|
||||
<artifactId>gameyfin-frontend</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -133,9 +143,11 @@
|
||||
<include>**/*.js</include>
|
||||
<include>**/*.css</include>
|
||||
<include>**/*.html</include>
|
||||
<include>**/*.ico</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -151,30 +163,26 @@
|
||||
</plugin>
|
||||
|
||||
<!-- Import the compiled frontend -->
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>merge</id>
|
||||
<phase>initialize</phase>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>de.grimsi.gameyfin</groupId>
|
||||
<artifactId>frontend</artifactId>
|
||||
<version>${gameyfin-frontend.version}</version>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${project.build.directory}/classes/static</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${basedir}/src/main/resources/static</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.parent.basedir}/frontend/dist/frontend/</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>-->
|
||||
</plugin>
|
||||
|
||||
<!-- Protobuf source generation 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.core.userdetails.User;
|
||||
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.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.HttpStatusEntryPoint;
|
||||
@@ -40,9 +42,9 @@ public class SecurityConfiguration {
|
||||
@Bean
|
||||
public InMemoryUserDetailsManager userDetailsService() {
|
||||
UserDetails user = User
|
||||
.withDefaultPasswordEncoder()
|
||||
.builder()
|
||||
.username(username)
|
||||
.password(password)
|
||||
.password("{noop}" + password) // FIXME: not very secure
|
||||
.authorities("ADMIN_API_ACCESS")
|
||||
.build();
|
||||
return new InMemoryUserDetailsManager(user);
|
||||
|
||||
@@ -8,8 +8,8 @@ gameyfin.password=
|
||||
# Root folder of your game library
|
||||
gameyfin.root=
|
||||
# Folders where gameyfin will store cached images and the database
|
||||
gameyfin.cache=${gameyfin.root}\.gameyfin\cache
|
||||
gameyfin.db=${gameyfin.root}\.gameyfin\db
|
||||
gameyfin.cache=${gameyfin.root}/.gameyfin/cache
|
||||
gameyfin.db=${gameyfin.root}/.gameyfin/db
|
||||
|
||||
# File extensions which gameyfin will recognize as game files
|
||||
gameyfin.file-extensions=iso, zip, rar, 7z, exe
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>frontend</artifactId>
|
||||
<artifactId>gameyfin-frontend</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
|
||||
<resources>
|
||||
<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>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
<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()">
|
||||
<mat-icon>refresh</mat-icon>
|
||||
</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()">
|
||||
<mat-icon>youtube_searched_for</mat-icon>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user