ENV: springboot 2.0.5.RELEASE, jolokia 1.5.0
How to disable jokolia authentication?
Endpoint jolokia response looks like following:
{
"request": {
"type": "version"
},
"value": {
"agent": "1.5.0",
"protocol": "7.2",
"config": {
"listenForHttpService": "true",
"authIgnoreCerts": "false",
"agentId": "172.22.0.3-7-72f8afb3-servlet",
"debug": "false",
"agentType": "servlet",
"policyLocation": "classpath:/jolokia-access.xml",
"agentContext": "/jolokia",
"serializeException": "false",
"mimeType": "text/plain",
"dispatcherClasses": "org.jolokia.http.Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher",
"authMode": "basic",
"streaming": "true",
"canonicalNaming": "true",
"historyMaxEntries": "10",
"allowErrorDetails": "true",
"allowDnsReverseLookup": "true",
"realm": "jolokia",
"includeStackTrace": "true",
"useRestrictorService": "false",
"debugMaxEntries": "100"
},
"info": {
"product": "tomcat",
"vendor": "Apache",
"version": "8.5.34"
}
},
"timestamp": 1538476345,
"status": 200
}
Same user application environment with springboot 1.5.9.RELEASE and jokolia 1.3.7 no authentication necessary. Endpoint jokolia responds like following:
{
"request": {
"type": "version"
},
"value": {
"agent": "1.3.7",
"protocol": "7.2",
"config": {
"agentId": "172.27.0.2-6-57fcc568-servlet",
"agentType": "servlet"
},
"info": {
"product": "tomcat",
"vendor": "Apache",
"version": "8.5.23"
}
},
"timestamp": 1538487291,
"status": 200
}
You should place the file jolokia-access.xml in src/main/resources so that it is part of the classpath.
Quote from my comment: Solved using ignoring management port altogether. I was using web.ignoring().requestMatchers(EndpointRequest.toAnyEndpoint()). It seems like it only matches requests to the level of those endpoints, but not levels deeper.
Related
Hello everyone I have a healthcheck on my consul service, my goal is whenever the service is unhealthy then the consul should remove them from the service catalog.
Bellow is my config
{
"service": {
"name": "api",
"tags": [ "api-tag" ],
"port": 80
},
"check": {
"id": "api_up",
"name": "Fetch health check from local nginx",
"http": "http://localhost/HealthCheck",
"interval": "5s",
"timeout": "1s",
"deregister_critical_service_after": "15s"
},
"data_dir": "/consul/data",
"retry_join": [
"192.168.0.1",
"192.168.0.2",
]
}
Thanks for all the helps
The reason the service is not being de-registered is that the check is being specified outside of the service {} block in your JSON. This makes the check a node-level check, not a service-level check.
Here's a pretty-printed version of the config you provided.
{
"service": {
"name": "api",
"tags": [
"api-tag"
],
"port": 80
},
"check": {
"id": "api_up",
"name": "Fetch health check from local nginx",
"http": "http://localhost/HealthCheck",
"interval": "5s",
"timeout": "1s",
"deregister_critical_service_after": "15s"
},
"data_dir": "/consul/data",
"retry_join": [
"192.168.0.1",
"192.168.0.2",
]
}
Below is the configuration you should be using in order to correctly associate the check with the configured service, and de-register the service after the check has been marked as critical for more than 15 seconds.
{
"service": {
"name": "api",
"tags": [
"api-tag"
],
"port": 80,
"check": {
"id": "api_up",
"name": "Fetch health check from local nginx",
"http": "http://localhost/HealthCheck",
"interval": "5s",
"timeout": "1s",
"deregister_critical_service_after": "15s"
}
},
"data_dir": "/consul/data",
"retry_join": [
"192.168.0.1",
"192.168.0.2"
]
}
Note this statement from the docs for DeregisterCriticalServiceAfter.
If a check is in the critical state for more than this configured value, then its associated service (and all of its associated checks) will automatically be deregistered. The minimum timeout is 1 minute, and the process that reaps critical services runs every 30 seconds, so it may take slightly longer than the configured timeout to trigger the deregistration. This should generally be configured with a timeout that's much, much longer than any expected recoverable outage for the given service.
When I try to use this app.json:
{
"stack": "heroku-18",
"repository": "https://github.com/OpenHumans/oh-data-source-template",
"logo": "https://avatars.githubusercontent.com/u/3341265?s=280&v=4",
"scripts": {
"postdeploy": "python manage.py init_proj_config"
},
"env": {
"SECRET_KEY": {
"description": "This is set for you and is used to encrypt data.",
"generator": "secret"
},
"OH_CLIENT_ID": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"OH_CLIENT_SECRET": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"OH_ACTIVITY_PAGE": {
"description": "See http://openhumans.org/direct-sharing/projects/manage",
"value": ""
},
"APP_BASE_URL ": {
"description": "e.g. https://your-app-name.herokuapp.com - no trailing slash!",
"value": "https://your-app-name.herokuapp.com"
},
"DEBUG": {
"description": "Displays detailed error info for web requests. Set False in production.",
"value": "false"
},
"HEROKU_APP": {
"description": "If true, ALLOWED_HOSTS is set to all.",
"value": "true"
}
},
"addons": [
"coralogix:free-30mbday",
"heroku-redis:hobby-dev",
{
"plan": "heroku-postgresql",
"options": {
"version": "9.5"
}
}
]
}
to deploy from:
https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fmikepsinn%2Foh-quantimodo-source
I get the error no matter what I set the name to:
I've tried adding the optional name field to the app.json but that doesn't help either.
I am trying to enable policy via Android Management API.
{
"name": "enterprises/LC03hx99sc/policies/default",
"version": "2",
"applications": [
{
"packageName": "app.caredirect.caredirecthub2",
"installType": "KIOSK"
},
{
"packageName": "com.android.settings",
"installType": "FORCE_INSTALLED",
"defaultPermissionPolicy": "GRANT"
},
{
"packageName": "com.amazon.dee.app",
"installType": "FORCE_INSTALLED",
"defaultPermissionPolicy": "GRANT"
}
],
"systemUpdate": {
"type": "WINDOWED",
"startMinutes": 10,
"endMinutes": 1439
},
"debuggingFeaturesAllowed": true
}
The store listing says for app.caredirect.caredirecthub2 that it is available in EVERY country.
Despite this I get the following error:
{
"name": "enterprises/LC03hx99sc/devices/33ddb8137f60b585",
"managementMode": "DEVICE_OWNER",
"state": "ACTIVE",
"appliedState": "ACTIVE",
"nonComplianceDetails": [{
"settingName": "applications",
"nonComplianceReason": "APP_NOT_INSTALLED",
"packageName": "app.caredirect.caredirecthub2",
"installationFailureReason": "NOT_AVAILABLE_IN_COUNTRY"
}, {
"settingName": "persistentPreferredActivities",
"nonComplianceReason": "APP_NOT_INSTALLED",
"packageName": "app.caredirect.caredirecthub2"
}],
"enrollmentTime": "2020-09-23T15:02:52.290Z",
"lastStatusReportTime": "2020-09-23T15:02:57.915Z",
"lastPolicySyncTime": "2020-09-23T15:02:53.754Z",
"appliedPolicyVersion": "1",
"apiLevel": 28,
"softwareInfo": {
"androidVersion": "9",
"androidDevicePolicyVersionCode": 1317100,
"androidDevicePolicyVersionName": "13.17.10.v32",
"androidBuildNumber": "TB-X605F_S210208_200807_ROW",
"deviceKernelVersion": "3.18.120-perf-g1d02637-dirty",
"bootloaderVersion": "unknown",
"androidBuildTime": "2020-08-07T10:08:52Z",
"securityPatchLevel": "2020-08-01",
"primaryLanguageCode": "en-US",
"deviceBuildSignature": "1c41fedecacbe89b81c242ecf74929f7d57322b64f8179c1c78a390a3494f14a",
"systemUpdateInfo": {
"updateStatus": "UP_TO_DATE"
}
},
"hardwareInfo": {
"brand": "Lenovo",
"hardware": "qcom",
"manufacturer": "LENOVO",
"serialNumber": "HA0Y8JQX",
"model": "Lenovo TB-X605F"
},
"appliedPolicyName": "enterprises/LC03hx99sc/policies/default",
"memoryInfo": {
"totalRam": "1909563392",
"totalInternalStorage": "3121049600"
},
"userName": "enterprises/LC03hx99sc/users/106404730049843005283",
"enrollmentTokenName": "enterprises/LC03hx99sc/enrollmentTokens/1019LI5YbxD4MNgIOfRKRxxKtK4ZLzRBZTGlL0Tw5Ns",
"previousDeviceNames": ["enterprises/LC03hx99sc/devices/3832aa78af19d796", "enterprises/LC03hx99sc/devices/326e9eaec5f835db", "enterprises/LC03hx99sc/devices/3f22065004da99b8", "enterprises/LC03hx99sc/devices/3027d6b05179f8ac", "enterprises/LC03hx99sc/devices/3011e18ade8e09f3", "enterprises/LC03hx99sc/devices/36ea1951ef4e088f", "enterprises/LC03hx99sc/devices/30fb71bc476a4d1d", "enterprises/LC03hx99sc/devices/3695657a941cba4a"],
"securityPosture": {
"devicePosture": "SECURE"
},
"ownership": "COMPANY_OWNED"
}
What is causing NOT_AVAILABLE_IN_COUNTRY ?
This is preventing the whole kiosk setup from working.
thanks
I want to run HTTP checks on services registered as External Services with consul.So far the check gets registered but is never called.
What am I missing.
{
"Datacenter": "dc1",
"Node": "new",
"Address": .google.com",
"Service": {
"ID":"re",
"Service": "search2",
"Port": 80
},
"Check":{
"Node":"new",
"CheckID":"Test",
"HTTP":"http://www.google",
"ServiceID":"re"
}
}
You have to specify Interval to check service health.You can do it as follows:
For TCP port check:
{
"check": {
"id": "http",
"name": "http TCP on port 80",
"tcp": "localhost:80",
"interval": "10s",
"timeout": "1s"
}
}
For HTTP api check:
{
"check": {
"id": "api",
"name": "HTTP API on port 5000",
"http": "https://localhost:5000/health",
"tls_skip_verify": false,
"method": "POST",
"header": {"x-foo":["bar", "baz"]},
"interval": "10s",
"timeout": "1s"
}
}
Using the latest VS Code and the excellent Chrome Debug extension.
I have one site that I can't get debugging to work and it's because the code I want to debug is in an iframe. Just running the page in the frame won't work for me (because auth and postMessage and more).
The folder structure in Chrome DevTools looks like the following: http://imgur.com/2VLjD1j. I want to debug the wfm folder selected, which is what I have open in VSCode.
The mapping as hosted by the web server is (though I can't hit this directly - this is what Chrome maps to if I try to use their workspace->code automap):
https://localhost:4300/contact-center/components/wfm
I don't see any way to tell the plugin that I want to debug this iframe in launch.json, but for completeness here's what I have so far:
{
"name": "Launch with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "https://localhost:4300/dca",
"sourceMaps": true,
"userDataDir": "/Users/${env.USER}/Library/Application\\ Support/Google/ChromePersonal",
"webRoot": "${workspaceRoot}"
}
Hah, it's been 5 years! I faced the same problem and switched to using VS Code Debugger for Firefox to debug an Outlook add-in.
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "firefox",
"request": "attach",
"name": "Firefox: Attach",
"webRoot": "${workspaceFolder}/src",
"url": "https://addin.example.com",
"tabFilter": "https://outlook.office.com/*",
"preLaunchTask": "Firefox debugger",
"pathMappings": [
{
"url": "webpack:///",
"path": "${webRoot}/"
},
{
"url": "webpack://./",
"path": "${webRoot}/"
},
{
"url": "webpack:///**",
"path": "${workspaceFolder}/src"
},
{
"url": "webpack:///node_modules/",
"path": null
}
],
"skipFiles": [
"chrome://**",
"moz-extension://**",
"**/node_modules/**"
],
"log": {
"consoleLevel": {
"PathConversion": "Error",
"SkipFilesManager": "Error",
"DebugConnection": "Error",
"ThreadActorProxy": "Error",
"TabActorProxy": "Error",
"SourceMappingThreadActorProxy": "Error",
"SourceActorProxy": "Error",
"net": "Error",
"ConsoleActorProxy": "Error",
"ConsoleActor": "Error",
"FirefoxDebugSession": "Error",
"FirefoxDebugAdapter": "Error",
"RootActorProxy": "Error",
"TabDescriptorActorProxy": "Error",
"DataBreakpointsManager": "Error",
"BreakpointsManager": "Error",
"SourceAdapter": "Error",
"SourceMappingSourceActorProxy": "Error",
"SourceMappingInfo": "Error",
"ThreadPauseCoordinator": "Error",
"FrameActorProxy": "Error",
"ObjectGripActorProxy": "Error",
"ThreadCoordinator": "Error",
"default": "Debug"
}
}
}
]
}
"preLaunchTask": "Firefox debugger" - comes from .vscode/tasks.json
"url": "https://addin.example.com" - iframe's URL
"tabFilter": "https://outlook.office.com/*" - instructs to search iframe in specific tabs
.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Firefox debugger",
"osx": {
"type": "shell",
"command": "/Applications/Firefox.app/Contents/MacOS/firefox --start-debugger-server"
},
"windows" : {
"type": "shell",
"command": "\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -start-debugger-server"
}
}
]
}