Server Configured

This commit is contained in:
RIT Services
2026-08-03 12:28:42 +00:00
parent 9f419a2503
commit fafb8d5bce
19 changed files with 93 additions and 131 deletions

View File

@@ -120,6 +120,7 @@ public class SecurityConfig {
List<String> origins = Arrays.asList(allowedOriginsStr.split(","));
configuration.setAllowedOrigins(origins);
configuration.setAllowedOriginPatterns(List.of(
"*",
"http://localhost:*",
"http://127.0.0.1:*",
"http://192.168.*:*",

View File

@@ -316,14 +316,7 @@ public class DatabaseSeeder implements CommandLineRunner {
systemUserRepository.save(admin);
System.out.println(">>> SEEDED ADMIN MASTER USER (username: " + targetUsername + ")");
} else {
SystemUser admin = existingAdmin.get();
admin.setPassword(passwordEncoder.encode(targetPassword));
admin.setRole("MASTER");
if (admin.getPermissions() == null || admin.getPermissions().isEmpty()) {
admin.setPermissions(List.of("dashboard", "sale", "customers", "purchases", "inventory", "expense", "reports", "stores", "table", "wallet", "promotions", "feedback"));
}
systemUserRepository.save(admin);
System.out.println(">>> VERIFIED & UPDATED ADMIN MASTER USER credentials for: " + targetUsername);
System.out.println(">>> ADMIN MASTER USER already exists. Skipping overwrite.");
}
}
}

View File

@@ -6,9 +6,9 @@ server.port=8080
# DATABASE — REQUIRED environment variables
# Set these in your environment or a .env file
# ============================================================
spring.datasource.url=jdbc:postgresql://localhost:5432/positeasy
spring.datasource.url=jdbc:postgresql://localhost:5432/rit_cms
spring.datasource.username=postgres
spring.datasource.password=sidharth
spring.datasource.password=RITHosting123
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=update