diff --git a/apps/api/fly.toml b/apps/api/fly.toml deleted file mode 100644 index 6075447..0000000 --- a/apps/api/fly.toml +++ /dev/null @@ -1,41 +0,0 @@ -app = "mally-api" -kill_signal = "SIGINT" -kill_timeout = 5 -primary_region = "gig" -processes = [] - -[env] -PORT = "8080" - -[experimental] -auto_rollback = true - -[[services]] -http_checks = [] -internal_port = 8080 -processes = ["app"] -protocol = "tcp" -script_checks = [] -[services.concurrency] -hard_limit = 25 -soft_limit = 20 -type = "connections" - -[[services.ports]] -force_https = true -handlers = ["http"] -port = 80 - -[[services.ports]] -handlers = ["tls", "http"] -port = 443 - -[[services.tcp_checks]] -grace_period = "1s" -interval = "15s" -restart_limit = 0 -timeout = "2s" - -[[vm]] -size = "shared-cpu-2x" -memory = "512mb" diff --git a/apps/api/pom.xml b/apps/api/pom.xml index 6f8f090..a8a9848 100644 --- a/apps/api/pom.xml +++ b/apps/api/pom.xml @@ -100,19 +100,9 @@ 0.12.0 - javax.cache - cache-api - 1.1.1 - - - com.hazelcast - hazelcast-spring - 5.5.0 - - - com.h2database - h2 - runtime + org.ehcache + ehcache + jakarta org.springframework.boot diff --git a/apps/api/src/main/resources/application.prod.yml b/apps/api/src/main/resources/application.prod.yml index 486e52b..fc2179d 100644 --- a/apps/api/src/main/resources/application.prod.yml +++ b/apps/api/src/main/resources/application.prod.yml @@ -12,8 +12,7 @@ spring: cache: jcache: - provider: com.hazelcast.cache.impl.HazelcastServerCachingProvider - config: classpath:hazelcast.xml + config: classpath:ehcache.xml security: oauth2: @@ -30,40 +29,48 @@ bucket4j: cache-name: buckets http-response-body: '{ "status": "error", "message": "Too many requests", "data": null, "errors": [] }' url: /url-shortener/redirect/.* + http-response-headers: + Access-Control-Allow-Origin: ${FRONTEND_URL} rate-limits: - cache-key: getRemoteAddr() bandwidths: - - capacity: 20 + - capacity: 50 time: 1 unit: minutes - id: url_shortener_shorten cache-name: buckets http-response-body: '{ "status": "error", "message": "Too many requests", "data": null, "errors": [] }' url: /url-shortener/shorten + http-response-headers: + Access-Control-Allow-Origin: ${FRONTEND_URL} rate-limits: - cache-key: getRemoteAddr() bandwidths: - - capacity: 10 + - capacity: 30 time: 1 unit: hours - id: pastebin_get_paste cache-name: buckets http-response-body: '{ "status": "error", "message": "Too many requests", "data": null, "errors": [] }' url: /pastebin/paste/.* + http-response-headers: + Access-Control-Allow-Origin: ${FRONTEND_URL} rate-limits: - cache-key: getRemoteAddr() bandwidths: - - capacity: 20 + - capacity: 50 time: 1 unit: minutes - id: pastebin_paste cache-name: buckets http-response-body: '{ "status": "error", "message": "Too many requests", "data": null, "errors": [] }' url: /url-shortener/shorten + http-response-headers: + Access-Control-Allow-Origin: ${FRONTEND_URL} rate-limits: - cache-key: getRemoteAddr() bandwidths: - - capacity: 10 + - capacity: 30 time: 1 unit: hours diff --git a/apps/api/src/main/resources/application.testing.yml b/apps/api/src/main/resources/application.testing.yml index 231fd64..0398193 100644 --- a/apps/api/src/main/resources/application.testing.yml +++ b/apps/api/src/main/resources/application.testing.yml @@ -12,8 +12,7 @@ spring: cache: jcache: - provider: com.hazelcast.cache.impl.HazelcastServerCachingProvider - config: classpath:hazelcast.xml + config: classpath:ehcache.xml security: oauth2: diff --git a/apps/api/src/main/resources/application.yml b/apps/api/src/main/resources/application.yml index 21fb528..2b29ae7 100644 --- a/apps/api/src/main/resources/application.yml +++ b/apps/api/src/main/resources/application.yml @@ -12,8 +12,7 @@ spring: cache: jcache: - provider: com.hazelcast.cache.impl.HazelcastServerCachingProvider - config: classpath:hazelcast.xml + config: classpath:ehcache.xml security: oauth2: diff --git a/apps/api/src/main/resources/ehcache.xml b/apps/api/src/main/resources/ehcache.xml new file mode 100644 index 0000000..e0244cb --- /dev/null +++ b/apps/api/src/main/resources/ehcache.xml @@ -0,0 +1,17 @@ + + + + 3600 + + 1000000 + + + + 1000000 + + + \ No newline at end of file diff --git a/apps/api/src/main/resources/hazelcast.xml b/apps/api/src/main/resources/hazelcast.xml deleted file mode 100644 index ca83378..0000000 --- a/apps/api/src/main/resources/hazelcast.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - true - - - - true - - - - - - 127.0.0.1 - - - - \ No newline at end of file