How is your experience with the OutSystems Community?
environment-info
Service icon

Environment Info

Stable version 1.4.0 (Compatible with OutSystems 11)
Uploaded
 on 10 Nov (14 hours ago)
 by 
5.0
 (7 ratings)
environment-info

Environment Info

Details
Make your apps environment-aware: detect Production, hostnames and real client IPs.
Read more

Stop guessing where your code is running.

Hardcoding environment checks is risky and hard to maintain. Environment Info lets your apps detect where they run straight from the platform, with zero configuration and no Site Properties.

What you get

  • Safer releases: check IsProductionEnvironment or the server mode before running risky logic, like sending emails or loading test data.
  • Correct links everywhere: get the environment's hostname even in Timers and BPTs, where GetRequestDomain() fails.
  • The real client IP: on OutSystems Cloud, GetClientIPAddress returns the visitor's address and can't be fooled by a forged header.
  • Faster troubleshooting: log the environment, Front-End and server details with your errors.
  • No surprises: actions don't throw; when a value isn't available, they return an empty one.


Limitations

Environment Info reads values through OutSystems platform assemblies that aren't a documented public API. A platform update can change them without notice, so test your apps after upgrading the platform and report any issue on GitHub.

Open source, with full documentation, on GitHub.

Release notes (1.4.0)

Breaking change: 

GetClientIPAddress

  • On OutSystems Cloud, it returns the real visitor's IP. It now ignores a forged X-Forwarded-For header, which 1.3.0 would return as the client IP. It reads the header from the right and skips the platform's trusted proxies and AWS CloudFront's addresses.
  • With trusted proxies disabled in Service Center, it still returns the first X-Forwarded-For entry. This is the usual on-premises setup, and that entry can still be forged.
  • Cleaner values. Ports are removed and IPv6 addresses are returned in a standard form. Empty, "unknown" or invalid values fall back to the connection address. Outside an HTTP request, it returns an empty string.
  • If you use your own CDN in front of OutSystems Cloud (Cloudflare, Akamai, and so on), the action now returns the CDN's address. To get the visitor's IP back, add the CDN's IP ranges as trusted proxies in Service Center.


Fixes:

  • GetEnvironmentName, GetEnvironmentKey, GetFrontEndName, IsProductionEnvironment and GetEnvironmentServerMode no longer throw when the platform context isn't available. Instead they return an empty string, False, or a ServerMode with Id 0 and an empty Name.
  • GetRuntimeInfo returns an empty OSVersion or MachineName when the server can't read it, instead of failing the whole action.
License (1.4.0)
Reviews (4)
by 
8 Jan
in version 1.1.0
Highly useful and easy to use
by 
7 Jan
in version 1.1.0
Super useful and easy to use.
by 
5 Jan
in version 1.1.0
Very usefull.
Team
Other assets in this category