Skip to content

Commit caad15c

Browse files
committed
prod issue
1 parent 6aaee49 commit caad15c

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

backend/src/main/java/com/thughari/jobtrackerpro/service/AuthService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public class AuthService {
3434

3535
@Value("${app.base-url}")
3636
private String baseUrl;
37-
38-
@Value("${CLOUDFLARE_PUBLIC_URL}")
39-
private String cloudFlarePublicUrl;
37+
38+
@Value("${cloudflare.r2.public-url.avatars}")
39+
private String avatarPublicUrl;
4040

4141
private final PasswordResetTokenRepository tokenRepository;
4242
private final EmailService emailService;
@@ -177,7 +177,7 @@ public UserProfileResponse updateProfileAtomic(String email, String name, String
177177
}
178178
else if (imageUrl != null && !imageUrl.isEmpty()) {
179179

180-
if (imageUrl.startsWith(cloudFlarePublicUrl) || imageUrl.contains(baseUrl)) {
180+
if (imageUrl.startsWith(avatarPublicUrl) || imageUrl.contains(baseUrl)) {
181181
newR2Url = imageUrl;
182182
} else {
183183
newR2Url = storageService.uploadFromUrl(imageUrl, user.getId().toString());

backend/src/main/resources/application-local.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ spring.servlet.multipart.max-file-size=5MB
4949
spring.servlet.multipart.max-request-size=5MB
5050

5151
# Local Storage (for testing, not for production)
52-
CLOUDFLARE_PUBLIC_URL=http://localhost:8080/api/storage/files
52+
cloudflare.r2.public-url.avatars=http://localhost:8080/api/storage/files
53+
cloudflare.r2.public-url.resources=http://localhost:8080/api/storage/files
5354

5455
# Google OAuth2 open https://console.cloud.google.com/auth/clients/create
5556
# Select Application name as JobTrackerPro Local

backend/src/main/resources/application-prod.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spring.datasource.hikari.max-lifetime=300000
1414
# Hibernate
1515
spring.jpa.hibernate.ddl-auto=update
1616
spring.jpa.show-sql=false
17+
spring.jpa.open-in-view=false
1718
#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialec
1819
#spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
1920

backend/src/test/resources/application-test.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ email.sender_email=noreply@test.local
3939
email.sender_name=JobTrackerPro Test
4040
email.sender_address=JobTrackerPro Test <noreply@test.local>
4141

42-
CLOUDFLARE_PUBLIC_URL=http://localhost:8080/api/storage/files
43-
cloudflare.r2.public-url=http://localhost:8080/api/storage/files
42+
cloudflare.r2.public-url.avatars=http://localhost:8080/api/storage/files
43+
cloudflare.r2.public-url.resources=http://localhost:8080/api/storage/files

0 commit comments

Comments
 (0)