Can a server determine the git version of the user client/agent - githooks

Can I use git hook to determine the version of the client/agent pushing?
I want to deny a push and send a message when the user/client is too old (or too new).

Not on the server side, as that information (git version) isn't part of what is being pushed.
You could ask the client to have a pre-push hook with your test in it, but there is no guarantee that this hook would be deployed (or bypassed by the user).

Related

HCW - hybrid configuration wizard modern - InternalUrl_Duplicate

Unable to get through the Hybrid Configuration Wizard in Modern mode. This is necessary because we want to migrate mailboxes. Classic mode works.
It knows that there is a Hybrid Agent, but I can't successfully install with either path of using existing or adding a new one. In Azure there is an App Proxy registration which appears to have the incorrect IP for the route to on-prem. This was due to a misconfiguration of our outgoing firewall. However after the firewall configuration was fixed, the App Proxy still has the old return IP, and there is no way in Azure to remove this record.
I've removed the app proxy components on the server, and let the HCW install again but this record is not updated or removed. Also have gone through 'Classic' path which according to community posts is supposed to remove the App Proxy record, but it doesn't.
According to what I've read, if the record is inactive for 10 days, it will be removed, but I'd rather resolve this without waiting for 10 days.
I've tried patching the record using Graph but it doesn't work.
2022.01.31 22:09:59.707 10333 [Client=UX, fn=SendAsync, Thread=15] FINISH Time=2170.2ms Results=BadRequest {"error":{"code":"InternalUrl_Duplicate","message":"Internal url 'https://LOCALFQDNSERVER/' is invalid since it is already in use","innerError":{"date":"2022-01-31T22:09:58","request-id":"d5c4dfe0-096d-4382-9da0-9559f45e0217","client-request-id":"d5c4dfe0-096d-4382-9da0-9559f45e0217"}}}

Bitbucket custom pre-receive hook for preventing unknown users to commit

Currently due to collaboration across different vendors and contractors sometimes they use a malformed git config at the client side when checking in code
Once the code is checked in, bitbucket does not reconcile the correct username against the commit often appearing as in bitbuckets commit section.
This is not desirable for audits and can potentially corrupt the commit trail
Need a custom pre commit hook to call the rest API to verfiy that the user has a account and email address against that REST Endpoint.
Using this tool https://github.com/lovato/hooks4git you can create that script in your preferred language. This tool helps you out with the hook management.
What everyone needs to do (in any client side git hook approach) in to install that tool and activate it.
Other options: https://githooks.com/

Post-receive githook to push database to live site

I'm busy workflow with Git. What I want to achieve is pushing a local repository with the database to Bitbucket and then automatically push the files to a server and put the mysqldump file into the database.
I can now make a mysqldump of the database with the git pre-commit hook and push this to my Bitbucket repo. After that I want to handle database import automaticcaly.
I found out that this is possible with the post-receive hook, but can't get it working. Where do I have to add that hook? I tried it in the local git hooks folder where my pre-commit hook is located, but it does nothing.
Anyone who can help me?
You can use a post-commit Webhook from Bitbucket (see documentation).
To handle the Webhook, you'll need a server that receives it, then pull the changes and executes whatever you want (your database import).
I made a small node app that receives these hooks if you're interested in re-using it: node-cd

Auto update feature in passbook ios 7

How does automatic updates work in passbook available in backfield of the pass, how to use webserviceURL key to get update from the server.
in webserviceURL key i have provided remote path from where updated pass can be downloaded, but even after content changed in server, it does not reflects in pass.
This question has been asked so many times, in so many ways, in so many forums; mostly by people that are too lazy to read the manual, or are too inexperienced / incompetent to understand it.
The first paragraph of the Passbook Web Service Reference explains why simply adding a link to an updated pass will not work.
A REST-style web service protocol is used to communicate with your server about changes to passes, and to fetch the latest version of a pass when it has changed. The endpoints always begin with the web service URL, as specified in the pass, followed by the protocol version number. For example, a request for the latest version of the pass of type com.apple.pass.example and serial number ABC123 might look like the following:
The Passbook web service is an integral part of the Passbook eco system. Anyone wishing to issue passes that change their content (either in response to a push message or in response to a user requesting fresh content by pulling down on the back of the pass), needs to implement their own Passbook web service.
This entails building a server capable of responding to the following to authenticated requests from each device that has installed your pass.
There are 5 methods that your web service should respond to:
1. Registering a Device to Receive Push Notifications for a Pass
POST request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
2. Getting the Serial Numbers for Passes Associated with a Device
GET request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag
3. Getting the Latest Version of a Pass
GET request to https://webServiceURL/v1/passes/passTypeIdentifier/serialNumber
4. Unregistering a Device
DELETE request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
5. Logging Errors
POST request to https://webServiceURL/v1/log
In order to have a pass respond to a manual refresh or push request you need to implement at least the first 3 methods. This is because the device will not issue any further requests until it has received a valid response to the registration request.
Furthermore, the web service must be available over https. An unsecured http service can be used for development, but production devices will only recognise a webServiceURL key that begins with https.

Passbook notification failing

Followed the intermediate Passbook tutorial from the book "iOS 6 by tutorials"
http://www.raywenderlich.com/store/ios-6-by-tutorials
I'm able to send a pass by email, add it to pass book, update it in my app and it updates when I open passbook but I'm not getting any notification. Notifications are turned on in the settings.
My guess is that it could be the firewall of my server. I'm new to the howl server setup. I'm running on a godaddy vps (centos).
When I run a list on iptables I get the following:
iptables -L -vn
Does this look right ?
Any clue appreciated !
Thanks
This is unlikely due to a firewall issue on the server side - but could possibly be an issue with the firewall of the router that your device is connected to. Apple delivers push notifications to devices on port 5223, so this needs to be open on your local router (assuming you are connected by wifi). If you can receive push notifications from other Apps (WhatsApp, Facebook, etc.) then you can rule out firewall as an issue.
You state that the pass does get updated - this implies that either a push is being received by Apple and is triggering the device to retrieve the new pass from your web service, or if you are using replacePassWithPass to update the pass via an App, this is functioning as expected.
In order for the pass to display a notification message:
A pass data field must have changed (changing pass types, colours, images or label values will not trigger a notification), and
The field must have the changeMessage key set (ideally the changeMessage contains %# which will be replaced by the new field value)
If the above two criteria are met and you are still not receiving a notification, then try hooking your device up to Xcode and watching the console log as you update a pass.

Resources