Compute Engine reverts firewall http/https rules automatically - google-compute-engine

I set the http/https rules through the UI on my VM,
everything looks fine for roughly 2 hours, and then automatically I found them deactivated.
Any idea why this happens, and how can I avoid it? (ie.: cron job from the VM to reset the rules)

To determine the source of the disabling of your firewall rules, I would suggest checking the logs of your firewall rule using the advanced query below.
resource.type="gce_firewall_rule"
resource.labels.firewall_rule_id="[FIREWALL_ID]"
If your issue is that the network tags have been removed from your instance, I would suggest checking the logs of your instance using the advanced query below, to determine the source of the issue.
resource.type="gce_instance"
resource.labels.instance_id="[INSTANCE_ID]"
logName=("projects/[PROJECT_ID]/logs/cloudaudit.googleapis.com%2Factivity" OR "projects/PROJECT_ID/logs/compute.googleapis.com%2Factivity_log")

Related

Monitoring headless Chrome

I'm using Chrome in headless mode via CDP (Chrome devtools protocol) to do HTML to PDF conversions. Works well but I do not trust Chrome to run forever and want to build a guardian service to monitor its responsiveness and if necessary kill the process and relaunch it.
What would be a good indicator of health? What I'm looking for is a low overhead test I can perform at fairly frequent intervals so that the restart latency is minimised.
I could try to perform some kind of CDP command if anyone has a suggestion and a reliable way to determine success.
I can't think of anything else, that's why I've thrown it open for suggestions.
My best suggestion for this case is to use the Target domain. Listening to some of the events that are fired from the target domain will give you some information regarding the state of your browser, such as TargetCrashed.
On top of that, you could use basic domains like Runtime (provides the evaluate method), SystemInfo or Browser to send the browser requests in order to check its health.

Is it possible to create a Google Chrome extension that can set my computer's network settings?

I have a device that uses Chrome browser for it's front end.
I would like to add a wizard to it, but I don't want to use up any more memory or storage space on the device, especially since the wizard will likely only be used once, during the initial device setup.
So, it is possible to create a Google Chrome extension that can access and change my computer's network settings, as long as I give it permission to do so, or is that completely out of scope for a Google Chrome extension?
Basically, I want the extension to walk the customer through the initial setup process, part of which includes configuring the computer's network settings to be compatible with the device's default network settings. At the end of the wizard, the extension would put the computer's network settings back to what they originally were.
Is it possible to create a Google Chrome extension that can access and change my computer's network settings, as long as I give it permission to do so [...]
No, no Chrome API provides this level of access. So an extension cannot do it on its own.
As wOxxOm mentions in a comment, it's possible to also provide a separate program (called Native Host) that an extension can start, then talk to it to do things outside of extension APIs. However, that complicates the deployment of such an extension: you can't add the host components to a Web Store app, you need a separate installer for it.
Presumably, you're targeting multiple OSes with the browser being an interface for your device; this further complicates your hypothetical "wizard" and its installer.
Perhaps the best you can do is clear documentation + an extension/webpage that can test connectivity and suggest troubleshooting steps.
Your requirement is not still clear.
But it is understood that you want to change the ip address settings through any app.which will store a basic setting saved.
it is possible for some specific area but I don't know what is your condition.

How to run Unsafe and Normal instance of Google Chrome at the same time?

I am doing some web development and am serving some files locally. Now both Chrome and Firefox wont allow me this because of their origin policy. As I prefer Chrome, I chose to to use it in unsafe mode by adding the --disable-web-security flag.
While this works perfectly, there is a slight issue I am facing. I can't run the chrome instance in unsafe mode while my another chrome instance is running in normal mode. If I open new instance by opening the unsafe mode chrome shortcut whilst my regular instance is running, the new instance also opens in regular mode; and vice-versa.
Is there a way to open both simultaneously? If so, how do I achieve this?
PS: I will use two different browsers for this as my last option. I would like to avoid this as far as possible
I found the answer on a Linux SuperUSer forum at
https://superuser.com/questions/593726/is-it-possible-to-run-chrome-with-and-without-web-security-at-the-same-time
I earlier thought this could only be done in Linux but this is also possible in Windows. Essentially we are asking a chrome to create a new instance altogether than sharing the same instance. We do this by giving it a location to store it's data. You can read about this in the above shared link.

Programmatically change Chrome extension update frequency

I'm developing a Chrome App (as a packaged app/extension) which purpose is to act as the base platform for several fullscreen apps to be build on top of. Chrome will be running on Ubuntu Linux.
And no trouble so far. But then I was told, that an intended app it is to be the platform for requires the source code to be updated with very short notice, as it probably is to be deployed for large scale use before the system has been tested through (even though it's a bad idea to deploy software that's not completely stable, but we're on a tight schedule). The problem is, that the "a few hours" interval for the autoupdating mechanism just isn't good enough.
So I somehow need to have the updating interval changed. I know this can be done with the --extensions-update-frequency command line switch, but as apps cannot access the command line (for obvious security reasons), and I'd prefer that the intended background page was to handle all the "administration", I don't think that switch is possible to use.
Is it somehow possible to update at a higher frequency? Or at times when it's ordered to?
There is now a method chrome.runtime.requestUpdateCheck():
Requests an update check for this app/extension.
It will return a status, which can be either "no_update", "update_available" or "throttled".
Unfortunately, the docs do not specify the limits for frequency that will trigger "throttled".
Your best option will be to have the extension manually check with your servers for an updated version. If there is an updated version show the user a desktop notification to manually update.
Potentially you could write a NPAPI plugin to modify the update frequency.
This may cause issues with CSP but you can try to live load JavaScript from your server that executes in the extension. In this case to "update" your extension you would simply update the JS hosted on your servers and the extension would automatically start using it on next load.

Increasing Google Chrome's max-connections-per-server limit to more than 6

As far as I know, at the current moment, late 2011 the max-connections-per-server limit remains 6. Please correct me if I am wrong. This is bad that we cannot fix this easily as in Firefox. As far as I know this value is hardcoded.
One of the solutions is to download the Chromium's sources and rebuild them. Is there a more easy solution?
Is there any tricky way to hack this without creating a dozen of mirror-domains?
Why I'm asking the question: My task is to create a html-javascript slideshow that will run inside a fullscreened browser, and a huge monitor is hanging on the wall. The javascript is really complicated, it preloads photos and makes a lot of ajax calls to my web services. If WIFI connection is slow, if 6 photos are loading, the AJAX calls fail, the application runs bad. I want a fast solution based, on http or browser or ubuntu tweak something else, because rebuilding the javascript app will take days.
Offtopic: do you know any other things that can be tweaked in my concrete situation?
IE is even worse with 2 connection per domain limit. But I wouldn't rely on fixing client browsers. Even if you have control over them, browsers like chrome will auto update and a future release might behave differently than you expect. I'd focus on solving the problem within your system design.
Your choices are to:
Load the images in sequence so that only 1 or 2 XHR calls are active at a time (use the success event from the previous image to check if there are more images to download and start the next request).
Use sub-domains like serverA.myphotoserver.com and serverB.myphotoserver.com. Each sub domain will have its own pool for connection limits. This means you could have 2 requests going to 5 different sub-domains if you wanted to. The downfall is that the photos will be cached according to these sub-domains. BTW, these don't need to be "mirror" domains, you can just make additional DNS pointers to the exact same website/server. This means you don't have the headache of administrating many servers, just one server with many DNS records.
I don't know that you can do it in Chrome outside of Windows -- some Googling shows that Chrome (and therefore possibly Chromium) might respond well to a certain registry hack.
However, if you're just looking for a simple solution without modifying your code base, have you considered Firefox? In the about:config you can search for "network.http.max" and there are a few values in there that are definitely worth looking at.
Also, for a device that will not be moving (i.e. it is mounted in a fixed location) you should consider not using Wi-Fi (even a Home-Plug would be a step up as far as latency / stability / dropped connections go).
BTW, HTTP 1/1 specification (RFC2616) suggests no more than 2 connections per server.
Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy. A proxy SHOULD use up to 2*N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times and avoid congestion.
There doesn't appear to be an external way to hack the behaviour of the executables.
You could modify the Chrome(ium) executables as this information is obviously compiled in. That approach brings a lot of problems with support and automatic upgrades so you probably want to avoid doing that. You also need to understand how to make the changes to the binaries which is not something most people can pick up in a few days.
If you compile your own browser you are creating a support issue for yourself as you are stuck with a specific revision. If you want to get new features and bug fixes you will have to recompile. All of this involves tracking Chrome development for bugs and build breakages - not something that a web developer should have to do.
I'd follow #BenSwayne's advice for now, but it might be worth thinking about doing some of the work outside of the client (the web browser) and putting it in a background process running on the same or different machines. This process can handle many more connections and you are just responsible for getting the data back from it. Since it is local(ish) you'll get results back quickly even with minimal connections.