kasramp / eris Goto Github PK
View Code? Open in Web Editor NEWEris Weather API
Home Page: https://eris.madadipouya.com/
License: GNU General Public License v3.0
Eris Weather API
Home Page: https://eris.madadipouya.com/
License: GNU General Public License v3.0
Currently weather extension
is unable to call the Eris due to CORS issue. Need to activate it.
This can be done either for a single endpoint /currentByIp
or all.
Follow the guide: https://developer.hashicorp.com/consul/tutorials/security/access-control-setup-production#apply-individual-tokens-to-agents
Example,
{
"acl_master_token": "YOUR_MASTER_TOKEN",
... // from the doc ,
"service": {
"name": "eris",
"token": "UUID"
},
"acl": {
"enabled": true,
"default_policy": "deny",
"enable_token_persistence": true,
"tokens": {
"agent": "AGENT_UUID"
}
}
}
To generate a token,
$ consul acl token create -description "Eris weather API service" -service-identity "eris" -secret "UUID"
The service identity name should match the actual service name and it's case sensitive
Replace @RequestMapping
with @GetMapping
.
Some of the third party services occasionally have outages, it will be good to use a circuit breaker and fall back to another service temporary if the default integration is inaccessible.
One example of circuit breaker is Hystrix but that's not maintained by Netflix anymore. Better to use other options.
Since Heroku no longer offers free-tier. Need to remove and use another PaaS provider to deploy
To ease calling the APIs from the Swagger UI provide sample coordinates in the API docs.
Because the CurrentWeatherCondition
is extending the OpenWeatherResponse
, the naming convention is not Java compliance.
As Hystrix has been deprecated and remove from Spring Cloud, need to replace it with Resilience4j. So that spring-cloud-dependencies
can be upgraded.
Because of this bug, it's not possible to upgrade to Spring Boot >= 2.6.0
. Better replace Springfox Swagger with SpringDoc OpenAPI. An example: https://github.com/kasramp/spring-redis-example
Need to use Spring Actuator
to be able to access the health endpoints. However, this endpoints should be secured. A basic approach is using environment variables and then later add the part for the database if needed.
Criteria:
/actuator
.white label
page.Currently the property names defined for actuator username and password are prefixed with health
. Change health.{username,password}
to actuator.{username,password}
.
Eris should be able to run in cluster, registering itself to Consul
Rearrange the pipeline flow as:
develop
environment-beta
or -develop
or as draft in GitHub and then automatically deploy the work to the staging
environment. It should use different API keys than productionAdd the javabrake dependency through your IDE or directly to your pom.xml
file:
<dependency>
<groupId>io.airbrake</groupId>
<artifactId>javabrake</artifactId>
<version>0.1.6</version>
</dependency>
Add javabrake to your Gradle dependencies:
compile 'io.airbrake:javabrake:0.1.6'
Add javabrake to your Ivy dependencies:
<dependency org='io.airbrake' name='javabrake' rev='0.1.6'>
<artifact name='javabrake' ext='pom'></artifact>
</dependency>
Import the javabrake library and copy the three configuration lines into your
app to send all uncaught exceptions to Airbrake:
(You can find your project API KEY with your project's settings)
// Import the library:
import io.airbrake.javabrake.Notifier;
public class ExampleApp {
public static void main(String[] args) {
// Copy configuration lines:
int projectId = <Your project ID>;
String projectKey = "<Your project API KEY>";
Notifier notifier = new Notifier(projectId, projectKey);
}
}
Example of reporting a caught exception:
try {
int i = 1/0;
} catch (ArithmeticException e) {
notifier.report(e);
}
Visit our official GitHub repo for advanced information and integrations like log4j, log4j2, and logback.
Update the website and add a section about how to run it using Docker as well as updating the readme file.
Some code in SecurityConfiguration is deprecated. It should be replaced:
Warning: /home/runner/work/Eris/Eris/src/main/java/com/madadipouya/eris/configuration/SecurityConfiguration.java:[35,10] httpBasic() in org.springframework.security.config.annotation.web.builders.HttpSecurity has been deprecated and marked for removal Warning: /home/runner/work/Eris/Eris/src/main/java/com/madadipouya/eris/configuration/SecurityConfiguration.java:[35,22] and() in org.springframework.security.config.annotation.SecurityConfigurerAdapter has been deprecated and marked for removal
In JUnit5 test classes and methods do not need to be public. Instead, they should be package private. To keep consistency with JUnit5, apply some changes in all test classes.
Currently, setters
in PropertyUtils.java
file are used for Unit testing. A correct approach is to load the values from a test property file and then do the assertions. This means it might be a need to convert the tests to run with SpringExtension
instead of MockitoExtension
.
Need to switch the project to Spring Boot 3 to utilize the latest offered features.
Version 9 of OWAP is too slow without an API_KEY. Need to figure out how to add a key into the pipeline to speed up the process. If it's not possible, simply use version 8.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.