@@ -148,6 +148,66 @@ Tip: In Swagger UI (/docs), click Authorize and paste `Bearer <JWT>`.
148148- Full OpenAPI specification (JSON + OCSM JSON-LD) available via endpoints
149149- Use [ Swagger Editor] ( https://editor.swagger.io/ ) to explore the API specification
150150
151+ ## Environment Variables
152+
153+ All The following can be set in a ` .env ` file or as system environment variables. They can also be found in the
154+ settings config file ` src/core/config.py ` . You can also check .env.example for getting skeleton of the env variables
155+ to get started with
156+
157+ ### Database and Server settings
158+
159+ We use MongoDB for storing historical weather data. Also MongoDb default port to be exposed is ` 27017 ` .
160+
161+ - ` WEATHER_SRV_DATABASE_URI ` – Database connection URL (default: SQLite ` mongodb://root:root@localhost:27017/ ` )
162+ - ` WEATHER_SRV_DATABASE_NAME ` - Database name (default: ` openagridb ` )
163+ - ` WEATHER_SRV_HOST ` – Host for the FastAPI server (default: ` weathersrv ` )
164+ - ` WEATHER_SRV_PORT ` – Port for the FastAPI server (default: ` 8000 ` )
165+
166+ ### Jwt and Security settings
167+
168+ Which are typical default values for development and testing. For production,
169+ you should change these to secure values and manage them safely. Gatekeeper for credentials is recommended.
170+
171+ - ` JWT_SECRET_KEY ` – Secret key for signing JWTs (default: ` some-key ` )
172+ - ` JWT_ALGORITHM ` – Algorithm for JWT (default: ` HS256 ` )
173+ - ` CRYPT_CONTEXT_SCHEMES ` – Password hashing schemes (default: ` bcrypt ` )
174+ - ` ACCESS_TOKEN_EXPIRE_MINUTES ` – Token expiry in minutes (default: ` 240 ` )
175+
176+ - ` GATEKEEPER_URL ` – Gatekeeper service URL (default: ``)
177+ - ` WEATHER_SRV_GATEKEEPER_USER ` – Gatekeeper username (default: ``)
178+ - ` WEATHER_SRV_GATEKEEPER_PASSWORD ` – Gatekeeper password (default: ``)
179+ - ` CURRENT_WEATHER_DATA_CACHE_TIME ` - Time interval between location data is cached in hours, (default: ` 1 ` )
180+
181+ ### External API Keys
182+
183+ Api keys for 3rd party services, Which the Weather Service uses to fetch weather data.
184+ Create free accounts to get your own keys, or use Gatekeeper to manage them.
185+
186+ - ` WEATHER_SRV_OPENWEATHERMAP_API_KEY ` – OpenWeatherMap API key (required for some features)
187+ - ` HISTORY_WEATHER_PROVIDER ` - Weather data provider for historical data (default: ` openmeteo ` )
188+ - ` GATEKEEPER_FARM_CALENDAR_API ` - Gatekeeper Farm Calendar API key (default: ` http://farmcalendar:8002/api/v1/ ` )
189+
190+ ### FARM Calendar settings
191+ Integrations to Farm calendar service for information on this visit
192+ [ OpenAgri-FarmCalendar] ( https://github.com/agstack/OpenAgri-FarmCalendar ) ,This service allows for manual recording of:
193+ farmers operations, farmers observations, parcels properties and recording of farms’ assets.
194+
195+ For the usage examples you can check the implementations in ` src/schedular.py ` , Which contains various schedules,
196+ and appropriate debug messages.
197+
198+ - ` PUSH_THI_TO_FARMCALENDAR ` - Boolean value to push data to farm calendar, (default: ` True ` )
199+ - ` PUSH_FLIGHT_FORECAST_TO_FARMCALENDAR ` - Push or Schedule UAV forcast to calendar, (default: ` False ` )
200+ - ` PUSH_SPRAY_F_TO_FARMCALENDAR ` - Push or Schedule spray forcast to calendar, (default: ` False ` )
201+ - ` INTERVAL_HOURS_THI_TO_FARMCALENDAR ` - Interval in hours between schedules, (default: ` 8 ` )
202+
203+ ### Testing and Misc
204+
205+ Variables related to testings, server and Debug.
206+
207+ - ` LOGGING_LEVEL ` - values can be ` DEBUG ` or ` info ` based on the testing level, (default: ` INFO ` )
208+ - ` EXTRA_ALLOWED_HOSTS ` - Allowed hosts for api communication, (Default: ` * ` )
209+ - ` LOCATION_RADIUS_METERS ` - The range from the current location to check the data for in meters, (default, ` 10000 ` )
210+
151211---
152212
153213## Example Requests
0 commit comments