Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1107 commits
Select commit Hold shift + click to select a range
7a7e52d
Make analytics feature preview less cramped on mobile
Villagers654 Jun 11, 2026
decf4d1
Only apply a fade to project cards if no banner is set
Villagers654 Jun 11, 2026
673a407
Show pre-releases in the download feature preview
Villagers654 Jun 11, 2026
bad81d2
Small tweaks for mobile
Villagers654 Jun 11, 2026
d6da08b
Small tweaks for mobile
Villagers654 Jun 11, 2026
dfd8982
Move metadata below the description on mobile
Villagers654 Jun 11, 2026
ee530c9
Adjustments for small desktop displays
Villagers654 Jun 11, 2026
a102d8f
Make sure all the pages use the right padding
Villagers654 Jun 11, 2026
50c9ff8
Don't allow navigating to categories that aren't pages
Villagers654 Jun 11, 2026
ae466de
'All Projects', not 'Mods'
Villagers654 Jun 11, 2026
3de349b
Show endpoints before schemas
Villagers654 Jun 11, 2026
21c7e8e
Enhance actions workflows
Villagers654 Jun 11, 2026
00320ee
Fix some compile warnings
Villagers654 Jun 11, 2026
0b4682f
Never have download modal come up empty
Villagers654 Jun 11, 2026
357ebd1
Use the actual component rather than a mock one when possible
Villagers654 Jun 11, 2026
9918269
Starting to work on optimizing the Browse page
Villagers654 Jun 11, 2026
c6877fd
Make some fixes to changes detection
Villagers654 Jun 11, 2026
b8b42a2
Allow marking a mod as incompatible
Villagers654 Jun 11, 2026
9fca021
Revert StatusModal styling
Villagers654 Jun 11, 2026
faf278c
Purge magic numbers/strings
Villagers654 Jun 11, 2026
1839eec
Fix buttons being invisible for some reason
Villagers654 Jun 11, 2026
be70b10
Fix annoying error
Villagers654 Jun 11, 2026
fcf4b13
Fix tests
Villagers654 Jun 11, 2026
2019bf3
Revert StatusModal
Villagers654 Jun 11, 2026
8972520
Optimize the marquee as best I can
Villagers654 Jun 11, 2026
37ce775
Only render the marquee when appropriate
Villagers654 Jun 11, 2026
32e0c5d
Optimize ranking scoring
Villagers654 Jun 12, 2026
302aab2
Make the projects endpoint as fast as I can
Villagers654 Jun 12, 2026
9218da8
Recompute ranking if favorite count changes
Villagers654 Jun 12, 2026
ea5102d
Fix deployment
Villagers654 Jun 12, 2026
5325bf3
More project endpoint tweaks
Villagers654 Jun 12, 2026
8fefc57
Optimize more endpoints
Villagers654 Jun 12, 2026
7d928a4
Speed up project detail pages and enforce slugs harder
Villagers654 Jun 12, 2026
ccea512
Speed up project detail pages and enforce slugs harder
Villagers654 Jun 12, 2026
96a48b9
Respect username slugs
Villagers654 Jun 12, 2026
cd66829
Use lightweight DTOs wherever possible
Villagers654 Jun 12, 2026
313ee58
Separate changelogs into their own DTO
Villagers654 Jun 12, 2026
d7b60fa
Refactor
Villagers654 Jun 12, 2026
c18e224
More skeletons
Villagers654 Jun 12, 2026
705b2b7
Fix tests
Villagers654 Jun 12, 2026
08b7441
Remove invalid annotations for enums
Villagers654 Jun 12, 2026
89c75a9
Expand backend tests
Villagers654 Jun 12, 2026
aec8815
Modpack/dependencies v2
Villagers654 Jun 12, 2026
22537aa
Fix tests
Villagers654 Jun 12, 2026
ef1f38e
Fix deployment
Villagers654 Jun 12, 2026
8015926
Put mods in the root
Villagers654 Jun 12, 2026
8370f01
Make external sources even more clear
Villagers654 Jun 12, 2026
ccffd16
Make body text always roughly the same length
Villagers654 Jun 12, 2026
2d157bf
Reuse project card skeletons for the marquee
Villagers654 Jun 12, 2026
2b9dfec
Simplify the browse page
Villagers654 Jun 12, 2026
62a418c
Fix custom license selection
Villagers654 Jun 12, 2026
1e3a2d5
Add CC BY-NC-SA 4.0
Villagers654 Jun 12, 2026
ef0b49f
redeploy the frontend actions pls
Villagers654 Jun 12, 2026
5238608
Fix some API key issues
Villagers654 Jun 13, 2026
ca5d5cf
Merge remote-tracking branch 'origin/main'
Villagers654 Jun 13, 2026
d639cd9
Redeploy the backend pls
Villagers654 Jun 13, 2026
235d86a
API key fixing part 2
Villagers654 Jun 13, 2026
685e940
Merge branch 'develop'
Villagers654 Jun 13, 2026
e18f887
Restore some favorites functionality
Villagers654 Jun 13, 2026
258f342
Merge branch 'develop' into modpack-v2
Villagers654 Jun 13, 2026
32807b1
Move 'My Favorites' tab to the bottom
Villagers654 Jun 13, 2026
b65879a
Improve reliability of actions
Villagers654 Jun 13, 2026
0c28263
Merge branch 'develop' into modpack-v2
Villagers654 Jun 13, 2026
bf29e97
Don't gate public endpoints
Villagers654 Jun 14, 2026
8e3bb71
Merge branch 'develop' into modpack-v2
Villagers654 Jun 15, 2026
e964821
Fix compile
Villagers654 Jun 15, 2026
9bb2b70
Merge branch 'develop' into modpack-v2
Villagers654 Jun 15, 2026
3c1fac7
Revert to 'any' when reset filters is pressed
Villagers654 Jun 15, 2026
6981551
Default to the latest release version, not version of any type
Villagers654 Jun 15, 2026
23a3415
Allow selecting how many results you want per page
Villagers654 Jun 15, 2026
6868573
Refine selecting multiple game versions at once in the filtering
Villagers654 Jun 15, 2026
08dd48f
Make sure modals always escape to center themselves on the display
Villagers654 Jun 15, 2026
64f8045
Untracked files strike again
Villagers654 Jun 15, 2026
cfb3242
Add 'last used' hint on auth
Villagers654 Jun 15, 2026
f8fc4fc
Slim project endpoints even further
Villagers654 Jun 15, 2026
511ede6
Mobile UI for HytaleModding wiki
Villagers654 Jun 15, 2026
750e823
Refine HytaleModding loading strategy
Villagers654 Jun 15, 2026
38ac9ec
Pass the tests
Villagers654 Jun 15, 2026
4b0a4ce
Fix banners being stuttery on project pages when scrolling
Villagers654 Jun 15, 2026
5963e0e
Remove gradients from bar graphs
Villagers654 Jun 15, 2026
c530e5c
More optimizations for HytaleModding wiki
Villagers654 Jun 15, 2026
7659245
Implement gallery carousel and image descriptions
Villagers654 Jun 15, 2026
329b63c
Properly hydrate dependencies in the sidebar
Villagers654 Jun 15, 2026
5351ca2
Allow embedding youtube videos into the gallery
Villagers654 Jun 15, 2026
ecd3127
Make it easy to embed gallery images into your description
Villagers654 Jun 15, 2026
ac5ba5b
Allow embedding the gallery carousel using markdown
Villagers654 Jun 15, 2026
a870314
Allow uploading a mod of the same game version and mod version (repla…
Villagers654 Jun 15, 2026
2fa9dd0
Fix project pages not fully hydrating sometimes
Villagers654 Jun 16, 2026
b1b4aeb
Share Gallery carousel for normal gallery popup too
Villagers654 Jun 16, 2026
69f5657
Make arrow keys work on gallery properly
Villagers654 Jun 16, 2026
3c8eaf0
Remove unused gallery carousel marker from settings tab
Villagers654 Jun 16, 2026
96fb0ae
Update ToS and Privacy Policy
Villagers654 Jun 16, 2026
df602c4
If a stored version contains 'pre', mark it as pre-release
Villagers654 Jun 16, 2026
cf2502b
If a stored version contains 'pre', mark it as pre-release
Villagers654 Jun 16, 2026
8205169
Fix full-screen project card previews
Villagers654 Jun 16, 2026
67cf239
Draw the marquee from popular sort and pad the list of projects out m…
Villagers654 Jun 16, 2026
137921c
First column scrolls faster
Villagers654 Jun 16, 2026
330eb30
Some refinements to analytics UI
Villagers654 Jun 16, 2026
f6622bc
Fix 'reset filters' button
Villagers654 Jun 16, 2026
63e3d05
Make dependency demo not hardcoded data
Villagers654 Jun 16, 2026
38d6577
Make the orgder of navbar and category selector line up
Villagers654 Jun 16, 2026
cc29274
Fix project pages refreshing sometimes
Villagers654 Jun 17, 2026
fa05a4e
Lighthouse actions
Villagers654 Jun 17, 2026
b4e9c34
Pass tests
Villagers654 Jun 17, 2026
421a5a7
Rewrite and re-expose status page
Villagers654 Jun 18, 2026
e0405da
Fix tests
Villagers654 Jun 18, 2026
660d4a9
Generate a mock DB for contributors
Villagers654 Jun 19, 2026
a23735e
Only generate the mock if the database storage changes
Villagers654 Jun 19, 2026
f57a1ad
Force mock db to generate
Villagers654 Jun 19, 2026
edbfffd
Force mock db to generate
Villagers654 Jun 19, 2026
50e66cc
Fix runner
Villagers654 Jun 19, 2026
e1dff42
Link properly
Villagers654 Jun 19, 2026
5ae6816
Fix DataSeeder
Villagers654 Jun 19, 2026
8d230d1
Lighthouse maxxing
Villagers654 Jun 19, 2026
51ab578
I should really start running tests *before* I commit
Villagers654 Jun 19, 2026
3e2c5a9
Merge develop into modpack-v2
Villagers654 Jun 19, 2026
fac0b2c
Allow filtering for open source projects
Villagers654 Jun 20, 2026
95d3663
Allow selecting by 0.5.x (for example) in the download modal
Villagers654 Jun 20, 2026
62038dc
Allow setting a custom license as open source
Villagers654 Jun 20, 2026
97fc09a
Allow 'inaccurate license' as a report type
Villagers654 Jun 20, 2026
77e6b7a
Make lighthouse not required to pass tests
Villagers654 Jun 20, 2026
a4a5514
Fix deploy
Villagers654 Jun 20, 2026
ee6c981
Merge branch 'develop' into modpack-v2
Villagers654 Jun 20, 2026
0b712d0
Add preview seeding action workflows
Villagers654 Jun 20, 2026
2efd09c
Attempt to redeploy
Villagers654 Jun 20, 2026
858938b
Fix trusted Cloud Build service account
Villagers654 Jun 20, 2026
14bb7f0
Restore streamed Cloud Build logs
Villagers654 Jun 20, 2026
5c9c968
Read Warden URL from GCP secret
Villagers654 Jun 20, 2026
01f02e7
Attempt to redeploy
Villagers654 Jun 21, 2026
185f129
Use configured Cloud Run runtime accounts
Villagers654 Jun 21, 2026
bf73198
Attempt to redeploy
Villagers654 Jun 21, 2026
c2f116e
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
5370577
Skip PR previews for same-repo branches
Villagers654 Jun 21, 2026
8c9db3d
Improve mock DB Mongo connection diagnostics
Villagers654 Jun 21, 2026
b9085e2
Require maintainer approval for PR previews
Villagers654 Jun 21, 2026
d23ea83
Use maintainer command for PR previews
Villagers654 Jun 21, 2026
081c2c7
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
9fedb6c
Attempt to redeploy
Villagers654 Jun 21, 2026
84879e3
Use account-owned Cloudflare token endpoints
Villagers654 Jun 21, 2026
f76a7ed
Attempt to redeploy
Villagers654 Jun 21, 2026
b25e5c3
Load branch R2 runtime credentials in current step
Villagers654 Jun 21, 2026
5efcb66
Attempt to redeploy
Villagers654 Jun 21, 2026
c530112
Fix some seeding issues
Villagers654 Jun 21, 2026
4b7f043
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
9564497
Fix same-repo PR workflow skips
Villagers654 Jun 21, 2026
e9c9690
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
f6ea21d
Refresh incomplete template seed imports
Villagers654 Jun 21, 2026
dc236b7
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
d664e23
Make branch preview logs discoverable
Villagers654 Jun 21, 2026
d4be442
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
26a24e0
Fix preview R2 download credentials
Villagers654 Jun 21, 2026
ac22ea7
Fix reloads on the project page
Villagers654 Jun 21, 2026
2a72622
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
0ef05c1
Make branch preview artifact seeding reliable
Villagers654 Jun 21, 2026
87d14c3
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
79a086a
Reuse branch preview R2 credentials
Villagers654 Jun 21, 2026
9307c7d
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
c29e70d
Make preview seeding manifest-driven
Villagers654 Jun 21, 2026
d197b35
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
3739d05
Fix branch preview R2 token provisioning
Villagers654 Jun 21, 2026
de344f7
Merge branch 'develop' into modpack-v2
Villagers654 Jun 21, 2026
6af8e54
Update gitignore
Villagers654 Jun 22, 2026
d3ad7d2
Get rid of placeholder seeding in the mock database
Villagers654 Jun 22, 2026
4561138
When looking at a draft project, hide the project visibility settings
Villagers654 Jun 23, 2026
bb303ba
Replace 'api %' with net new projects
Villagers654 Jun 26, 2026
8ab37b2
Update project dependencies
Villagers654 Jun 27, 2026
0bbcf05
Merge branch 'develop' into modpack-v2
Villagers654 Jun 27, 2026
fe3387d
Fix modpack dependency update fallout
Villagers654 Jun 27, 2026
6393058
Make the status page less dramatic
Villagers654 Jun 27, 2026
929392d
Fix status Discord webhook routing
Villagers654 Jun 27, 2026
d3bf6b7
Detach status service from main site
Villagers654 Jun 27, 2026
156a86b
Improve wiki bundle loading and render path
Villagers654 Jun 27, 2026
9af59f7
Forgot to add this
Villagers654 Jun 27, 2026
e1cab63
Fix the navbar pfp getting squished
Villagers654 Jun 27, 2026
dbf386a
Hide Comments button on narrow displays
Villagers654 Jun 27, 2026
0bc9647
Make "supported versions" in the project page sidebar collapse
Villagers654 Jun 27, 2026
40a0a0e
Fix some deployment issues
Villagers654 Jun 27, 2026
a7ad0f3
Sort game versions properly
Villagers654 Jun 27, 2026
26ddaf2
Fix some download modal issues
Villagers654 Jun 27, 2026
55d68b1
Merge branch 'develop' into modpack-v2
Villagers654 Jun 27, 2026
996cd44
Fix backend startup and render budget
Villagers654 Jun 28, 2026
b4fdec3
Fix backend startup and render budget
Villagers654 Jun 28, 2026
f10e379
Fix annoying styling issues
Villagers654 Jun 28, 2026
375c691
Fix annoying styling issues for real
Villagers654 Jun 28, 2026
b4c2b17
Improve SEO on project pages
Villagers654 Jul 1, 2026
ec9b567
Replace legacy admin system with proper fine grained admin permissions
Villagers654 Jul 1, 2026
e531269
Fix mock db deployments with temporary thing
Villagers654 Jul 1, 2026
e545975
Allow removing password sign in if you have an OAuth linked
Villagers654 Jul 1, 2026
1359b69
Fix cards overflowing on mobile
Villagers654 Jul 5, 2026
0b906b4
Prevent weird mfa edge case
Villagers654 Jul 14, 2026
23cbd9f
Fix admin permissions not being correctly assigned with authenticatin…
Villagers654 Jul 14, 2026
3c37493
Merge branch 'main' into develop
Villagers654 Jul 14, 2026
bf4c449
Add Hytale OAuth
Villagers654 Jul 19, 2026
252b7ce
Add Hytale OAuth
Villagers654 Jul 19, 2026
0b3e171
Update README.md
Villagers654 Jul 19, 2026
b7e09e2
Fix an issue preventing people from viewing their drafts in some cases
Villagers654 Jul 23, 2026
6f3ce5e
Merge branch 'develop' into modpack-v2
Villagers654 Jul 24, 2026
c296f9b
Fix duplicate project embed images
Villagers654 Jul 28, 2026
fccfa98
Fix duplicate project embed images
Villagers654 Jul 28, 2026
ee6f531
Merge remote-tracking branch 'origin/main' into develop
Villagers654 Aug 12, 2026
d85f0da
Reduce deployment infrastructure costs
Villagers654 Aug 12, 2026
14e9cd3
Keep production services warm
Villagers654 Aug 12, 2026
58af3c2
Reduce cache and deployment overhead
Villagers654 Aug 12, 2026
a28bc2f
Reduce Cloud Build compilation work
Villagers654 Aug 12, 2026
001160c
Merge develop cost optimizations
Villagers654 Aug 12, 2026
b98db86
Improve social links, API docs, and prefab support
Villagers654 Aug 12, 2026
5a6ffb9
Merge develop Keep cleanup
Villagers654 Aug 12, 2026
a14ea0a
Merge branch 'develop' into modpack-v2
Villagers654 Aug 12, 2026
5299415
Harden modpack dependency archives
Villagers654 Aug 12, 2026
a896a96
Add project and global version hash lookups
Villagers654 Aug 16, 2026
145a961
Merge develop version hash lookups
Villagers654 Aug 16, 2026
0425e42
Fix game version catalog ordering
Villagers654 Aug 21, 2026
da01256
Merge develop game version catalog ordering
Villagers654 Aug 21, 2026
0572598
Restore project team API routes
Villagers654 Aug 25, 2026
fa72e8b
Merge develop project team API routes
Villagers654 Aug 25, 2026
a1a2d52
Fix project invite acceptance pipeline
Villagers654 Aug 25, 2026
ba9198c
Merge develop project invite acceptance fix
Villagers654 Aug 25, 2026
b5271f8
Require canonical project notification metadata
Villagers654 Aug 25, 2026
0b2ea94
Merge canonical project notification metadata
Villagers654 Aug 25, 2026
43f2f40
Route deployment alerts to admin webhook
Villagers654 Aug 31, 2026
8e78d7f
Add data-driven profile badges
Villagers654 Aug 31, 2026
6c98548
Optimize admin verification queue
Villagers654 Sep 1, 2026
398b9cf
Merge admin verification queue optimization
Villagers654 Sep 1, 2026
8308e3e
Improve Hytale sign-in button contrast
Villagers654 Sep 3, 2026
fced7f0
Merge Hytale sign-in contrast improvement
Villagers654 Sep 3, 2026
de98fb2
Increase Hytale sign-in button contrast
Villagers654 Sep 3, 2026
d2d2435
Merge branch 'main' into modpack-v2
Villagers654 Sep 3, 2026
2a918e6
Update project dependencies
Villagers654 Sep 3, 2026
4af2f9e
Trigger dependency validation
Villagers654 Sep 3, 2026
d8db15f
Merge branch 'develop' into modpack-v2
Villagers654 Sep 3, 2026
89dcde7
Stabilize lazy import CI test
Villagers654 Sep 3, 2026
a033da8
Merge branch 'develop' into modpack-v2
Villagers654 Sep 3, 2026
f854e81
Harden CurseForge modpack references
Villagers654 Sep 3, 2026
03e9996
Fix CurseForge client injection
Villagers654 Sep 3, 2026
83325ac
Add reproducible modpack lockfiles
Villagers654 Sep 3, 2026
3a7b7e2
Add environment-aware modpack entries
Villagers654 Sep 3, 2026
9f725e2
Add client and server modpack exports
Villagers654 Sep 3, 2026
b3ea723
Add secure layered modpack overrides
Villagers654 Sep 3, 2026
81e901a
Persist verified CurseForge metadata
Villagers654 Sep 3, 2026
5f38369
Stabilize CurseForge metadata lookups
Villagers654 Sep 3, 2026
7d45b69
Deploy and harden detached status service
Villagers654 Sep 3, 2026
9a113b4
Complete status domain provisioning
Villagers654 Sep 3, 2026
8b697fa
Remove unavailable Cloudflare DNS automation
Villagers654 Sep 3, 2026
4cdaef8
Merge develop into modpack-v2
Villagers654 Sep 3, 2026
94a2483
Reconcile develop after history cleanup
Villagers654 Sep 3, 2026
da082fc
Substantially brighten Hytale sign-in button
Villagers654 Sep 3, 2026
4272c84
Build web localization foundation
Villagers654 Sep 3, 2026
3ae4904
Integrate web localization with modpack-v2
Villagers654 Sep 3, 2026
eda0850
Require launcher for CurseForge modpacks
Villagers654 Sep 3, 2026
1ff45eb
Merge develop into modpack-v2
Villagers654 Sep 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/cloudbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ substitutions:
_TAG: latest

options:
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
package net.modtale.config.db;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.ReplaceOptions;
import java.util.List;
import java.util.UUID;
import net.modtale.model.project.ProjectDependency;
import org.bson.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

@Component
public class ProjectDependencySchemaMigration {

private static final Logger logger = LoggerFactory.getLogger(ProjectDependencySchemaMigration.class);

private final MongoTemplate mongoTemplate;

public ProjectDependencySchemaMigration(MongoTemplate mongoTemplate) {
this.mongoTemplate = mongoTemplate;
}

@EventListener(ApplicationReadyEvent.class)
public void migrateLegacyDependencyDocuments() {
MongoCollection<Document> projects = mongoTemplate.getCollection("projects");
int changedProjects = 0;
int changedDependencies = 0;

for (Document project : projects.find(Filters.or(
Filters.exists("versions.dependencies.modId"),
Filters.exists("versions.dependencies.id", false),
Filters.exists("modIds")
))) {
int projectChanges = normalizeProject(project);
if (projectChanges == 0) {
continue;
}

projects.replaceOne(
Filters.eq("_id", project.get("_id")),
project,
new ReplaceOptions().upsert(false)
);
changedProjects++;
changedDependencies += projectChanges;
}

if (changedProjects > 0) {
logger.info("Migrated {} legacy dependency references across {} projects.", changedDependencies, changedProjects);
}
}

private int normalizeProject(Document project) {
int changes = normalizeProjectDependencyIndex(project);
Object rawVersions = project.get("versions");
if (!(rawVersions instanceof List<?> versions)) {
return changes;
}

for (Object versionObj : versions) {
if (!(versionObj instanceof Document version)) {
continue;
}
Object rawDependencies = version.get("dependencies");
if (!(rawDependencies instanceof List<?> dependencies)) {
continue;
}
for (Object dependencyObj : dependencies) {
if (dependencyObj instanceof Document dependency && normalizeDependency(dependency)) {
changes++;
}
}
}
return changes;
}

private int normalizeProjectDependencyIndex(Document project) {
if (!project.containsKey("modIds")) {
return 0;
}
Object legacyModIds = project.get("modIds");
if (!project.containsKey("childProjectIds") && legacyModIds instanceof List<?>) {
project.put("childProjectIds", legacyModIds);
}
project.remove("modIds");
return 1;
}

private boolean normalizeDependency(Document dependency) {
if (!dependency.containsKey("modId")
&& dependency.containsKey("projectId")
&& dependency.containsKey("dependencyType")
&& dependency.containsKey("id")) {
return false;
}

Object projectId = firstPresent(dependency, "projectId", "modId");
Object projectTitle = firstPresent(dependency, "projectTitle", "modTitle");
dependency.putIfAbsent("id", UUID.randomUUID().toString());
if (projectId != null) {
dependency.put("projectId", projectId);
}
if (projectTitle != null) {
dependency.put("projectTitle", projectTitle);
}
dependency.putIfAbsent("source", ProjectDependency.Source.MODTALE.name());
dependency.putIfAbsent("hytaleProjectConfirmed", false);
dependency.put("dependencyType", inferDependencyType(dependency));

dependency.remove("modId");
dependency.remove("modTitle");
dependency.remove("isOptional");
dependency.remove("isEmbedded");
return true;
}

private Object firstPresent(Document document, String primary, String fallback) {
Object primaryValue = document.get(primary);
return primaryValue != null ? primaryValue : document.get(fallback);
}

private String inferDependencyType(Document dependency) {
if (Boolean.TRUE.equals(dependency.getBoolean("isEmbedded"))) {
return ProjectDependency.DependencyType.EMBEDDED.name();
}
if (Boolean.TRUE.equals(dependency.getBoolean("isOptional"))) {
return ProjectDependency.DependencyType.OPTIONAL.name();
}
Object existingType = dependency.get("dependencyType");
if (existingType != null) {
return existingType.toString();
}
return ProjectDependency.DependencyType.REQUIRED.name();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.modtale.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "app.curseforge")
public record AppCurseForgeProperties(
String apiKey,
long hytaleGameId
) {
public boolean isConfigured() {
return apiKey != null && !apiKey.isBlank() && hytaleGameId > 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package net.modtale.controller.project;

import net.modtale.model.dto.project.ExternalProjectReferenceDTO;
import net.modtale.model.project.ProjectDependency;
import net.modtale.service.project.version.ExternalProjectReferenceService;
import org.springframework.http.CacheControl;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/api/v1")
public class ExternalProjectController {

private final ExternalProjectReferenceService externalProjectReferenceService;

public ExternalProjectController(ExternalProjectReferenceService externalProjectReferenceService) {
this.externalProjectReferenceService = externalProjectReferenceService;
}

@GetMapping("/projects/external/resolve")
@PreAuthorize("@apiSecurity.hasAnyPerm('PROJECT_READ', authentication)")
public ResponseEntity<ExternalProjectReferenceDTO> resolveExternalProject(
@RequestParam String url,
@RequestParam(required = false) ProjectDependency.Source source
) {
return ResponseEntity.ok()
.cacheControl(CacheControl.maxAge(10, TimeUnit.MINUTES).cachePublic())
.body(externalProjectReferenceService.resolve(url, source));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.modtale.model.dto.response.project.DownloadUrlResponse;
import net.modtale.model.dto.response.project.VersionDependenciesView;
import net.modtale.model.user.User;
import net.modtale.model.project.ModpackTarget;
import net.modtale.service.project.version.VersionApplicationService;
import net.modtale.service.project.version.VersionDownloadPayload;
import net.modtale.service.user.account.AccountService;
Expand Down Expand Up @@ -136,12 +137,14 @@ public ResponseEntity<DownloadUrlResponse> getDownloadUrl(
@PathVariable String id,
@PathVariable String version,
@RequestParam(value = "gameVersion", required = false) String gameVersion,
@RequestParam(value = "target", defaultValue = "UNIVERSAL") ModpackTarget target,
Authentication authentication
) {
return ResponseEntity.ok(versionApplicationService.createDownloadUrl(
id,
version,
gameVersion,
target,
accountService.getCurrentUser(authentication)
));
}
Expand Down
17 changes: 13 additions & 4 deletions backend/src/main/java/net/modtale/mapper/ProjectMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ public static ProjectDTO toDTO(Project project, boolean isSummary, String curren
if (!isSummary) {
dto.setAbout(project.getAbout());
dto.setChildProjectIds(project.getChildProjectIds());
dto.setModIds(project.getModIds());

dto.setProjectRoles(project.getProjectRoles());
dto.setTeamMembers(project.getTeamMembers());
Expand Down Expand Up @@ -426,11 +425,21 @@ private static AdminVerificationQueueScanDTO toVerificationQueueScanDTO(ScanResu
public static ProjectDependencyDTO toDependencyDTO(ProjectDependency dependency) {
if (dependency == null) return null;
return new ProjectDependencyDTO(
dependency.getModId(),
dependency.getModTitle(),
dependency.getId(),
dependency.getProjectId(),
dependency.getProjectTitle(),
dependency.getVersionNumber(),
dependency.getDependencyType(),
dependency.getEnvironment(),
dependency.getSource(),
dependency.getExternalId(),
dependency.getExternalUrl(),
dependency.getExternalFileUrl(),
dependency.getExternalFileName(),
dependency.getCachedFileUrl(),
dependency.isHytaleProjectConfirmed(),
dependency.getIcon(),
dependency.getTitle() != null ? dependency.getTitle() : dependency.getModTitle(),
dependency.getTitle() != null ? dependency.getTitle() : dependency.getProjectTitle(),
dependency.getClassification(),
dependency.getSlug(),
dependency.isOptional(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package net.modtale.model.dto.project;

import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
import java.util.Map;
import net.modtale.model.project.ProjectDependency;

@JsonInclude(JsonInclude.Include.NON_NULL)
public record ExternalProjectReferenceDTO(
ProjectDependency.Source source,
String externalId,
String title,
String versionNumber,
String externalUrl,
String iconUrl,
String summary,
boolean hytaleProjectConfirmed,
Boolean distributionAllowed,
List<ExternalFileDTO> files
) {
@JsonInclude(JsonInclude.Include.NON_NULL)
public record ExternalFileDTO(
String id,
String displayName,
String fileName,
String versionNumber,
String releaseType,
String downloadUrl,
Long fileSize,
Map<String, String> hashes,
List<String> gameVersions,
Integer fileStatus,
Boolean available
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class ManifestDependencySuggestion {
private String versionNumber;
private boolean optional;
private int confidence;
private String dependencyEntry;

public ManifestDependencySuggestion() {}

Expand All @@ -20,7 +19,6 @@ public ManifestDependencySuggestion(String manifestKey, String requestedVersion,
this.versionNumber = versionNumber;
this.optional = optional;
this.confidence = confidence;
this.dependencyEntry = projectId + ":" + versionNumber + (optional ? ":optional" : "");
}

public String getManifestKey() { return manifestKey; }
Expand All @@ -43,7 +41,4 @@ public ManifestDependencySuggestion(String manifestKey, String requestedVersion,

public int getConfidence() { return confidence; }
public void setConfidence(int confidence) { this.confidence = confidence; }

public String getDependencyEntry() { return dependencyEntry; }
public void setDependencyEntry(String dependencyEntry) { this.dependencyEntry = dependencyEntry; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class ProjectDTO {
private Map<String, String> links;
private List<String> types;
private List<String> childProjectIds;
private List<String> modIds;
private boolean allowModpacks;
private boolean allowComments;
private boolean hmWikiEnabled;
Expand Down Expand Up @@ -107,8 +106,6 @@ public class ProjectDTO {
public void setTypes(List<String> types) { this.types = types; }
public List<String> getChildProjectIds() { return childProjectIds; }
public void setChildProjectIds(List<String> childProjectIds) { this.childProjectIds = childProjectIds; }
public List<String> getModIds() { return modIds; }
public void setModIds(List<String> modIds) { this.modIds = modIds; }
public boolean isAllowModpacks() { return allowModpacks; }
public void setAllowModpacks(boolean allowModpacks) { this.allowModpacks = allowModpacks; }
public boolean isAllowComments() { return allowComments; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import net.modtale.model.project.ProjectClassification;
import net.modtale.model.project.ProjectDependency;

@JsonInclude(JsonInclude.Include.NON_NULL)
public record ProjectDependencyDTO(
String id,
String projectId,
String projectTitle,
String versionNumber,
ProjectDependency.DependencyType dependencyType,
ProjectDependency.Environment environment,
ProjectDependency.Source source,
String externalId,
String externalUrl,
String externalFileUrl,
String externalFileName,
String cachedFileUrl,
boolean hytaleProjectConfirmed,
String icon,
String title,
ProjectClassification classification,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CreateVersionRequest {

private List<@NotBlank(message = "Game version entries cannot be blank.") String> gameVersions;
private MultipartFile file;
private List<@NotBlank(message = "Dependency entries cannot be blank.") String> modIds;
private List<DependencyReferenceRequest> dependencies;
private List<@NotBlank(message = "Incompatible project entries cannot be blank.") String> incompatibleProjectIds;

@Size(max = 50000, message = "Version changelogs cannot exceed 50,000 characters.")
Expand Down Expand Up @@ -46,12 +46,12 @@ public void setFile(MultipartFile file) {
this.file = file;
}

public List<String> getModIds() {
return modIds;
public List<DependencyReferenceRequest> getDependencies() {
return dependencies;
}

public void setModIds(List<String> modIds) {
this.modIds = modIds;
public void setDependencies(List<DependencyReferenceRequest> dependencies) {
this.dependencies = dependencies;
}

public List<String> getIncompatibleProjectIds() {
Expand Down
Loading
Loading