GitBlit email notification on push and commit - email-notifications

I want to send email latter with commit diff, when each commit will pushed. I found some info here http://gitblit.com/setup_hooks.html, but i dont understand where should i put my Post-Receive, and what structure it will have. Can somebody help me with usefull links, or some info

Open file gitblit/data/gitblit.properties and add the following lines:
mail.server = <SMTP server>
mail.port = <SMTP port>
mail.username = <SMTP username>
mail.password = <SMTP password>
# Uncomment one line of these two depending on your SMTP server
# mail.smtps = true
# mail.starttls = true
mail.fromAddress = <SMTP from address, e.g. noreply#example.com>
mail.adminAddresses = <Admin email address (optional)>
groovy.postReceiveScripts = sendmail.groovy
That's it. If you set mail.adminAddresses Gitblit will send an email to that address on every push.
It is also possible to set the mailing list for a specific repository (open your repo → edit → miscellaneous → mailing lists):

Related

Managing personal and organisation GitHub accounts on the same machine(HTTPS)

So i have a mac given to me by organistaion for company work. My mac os verison is macOS Monterey version 12.6
Now i have one github account setup here for my company (2FA enabled and using HTTPS with Personal access token)
git version 2.37.0 (Apple Git-136)
Adding .git/config file output here (local file inside repo path).
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/<<company_name>>/<<repo_name>>.git
fetch = +refs/heads/*:refs/remotes/origin/*`
Adding global config file output (~/.gitconfig)
[credential]
helper = osxkeychain
[url "https://company_username#github.com"]
and inside keychain there are two enteries for github.com
Internet password
application password
Both having my personal access token for the company id.
This all works fine as PAT is saved in keychain.
Now i have created a new github account under my name (for personal projects) and following is the local .git/config file output there.
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
name = <<personal_username>>
email = <<personal_email_id>>
[remote "origin"]
url = https://<<PAT>>#github.com/<<personal_username>>/<<repo_name>>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[credential]
helper =
i have added PAT here so that it does not copies the one from keychain (as i tried different solutions online)
However, when i try to clone or push in this repo it gives error.
remote: Repository not found.
fatal: repository 'https://github.com/<<personal_user>>/<<repo>>.git/' not found
what i understand is it is taking PAT from keychain and that one is for my company's PAT so giving this error. However i might be wrong.
Adding output for my .netrc
machine github.com login <<company_username>> password <<company_PAT>>
I am able to think of two ways to do this
enable keychain for only company's repo and not for personal repo so that i can add PAT personal each time
Add different PAT for different account in keychain
However i am not able to come up with any solution after trying everything online.
Again, i am using HTTPS
(most of solution online are .SSH)
Thank you in advance.
https://<<PAT>>#github.com: you do not put the token when you work with credential helper.
You put your GitHub user account, the one you need to access that repository.
And you record in the credential helper the right PAT for that user.
I would recommend installing the Microsoft cross-platform GCM (Git Credential Manager), which will update osxkeychain.
Then record your personal user account and associated PAT:
printf "host=github.com\nprotocol=https\nusername=you\npassword=PAT" | git credential-manager store
# replace 'you' and 'PAT' with your own GitHub account and token
Using https://you#github.com/... (instead of https://company_username#github.com)will force Git to extract the right token from the credential helper.

Jython script to modify queue connection factories

I have queue manager already configured in Queue connection factories of websphere
currently settings are with out SSl enabled.
I want to enable this two things
Use SSL to secure communication with IBM MQ
specify the SSl to be used
Need your help to edit this things through jython
Use modifyWMQConnectionFactory command for this task.
See below example:
#Set QCF Name
qcfName='MYQCF'
#Set custom SSL config name
sslConfig='CUSTOMSSLSettings'
#Get the list of all QCF's in the environment
qcfList=AdminConfig.list('MQQueueConnectionFactory').splitlines()
#You can futher refine this command and restrict the query to a specific resource scope
#eg: qcfList=AdminConfig.list('MQQueueConnectionFactory', clusterId).splitlines()
#Iterate the list and update the config for MYQCF
for qcf in qcfList:
if qcfName == AdminConfig.showAttribute(qcf, 'name'):
print 'Enable SSL config for QCF: '+qcfName+' and use '+sslConfig+' SSL configuration'
AdminTask.modifyWMQConnectionFactory(qcf, '[-sslType SPECIFIC -sslConfiguration '+sslConfig+']')
else:
print 'Skip SSL config update for QCF: '+AdminConfig.showAttribute(qcf, 'name')
#save the changes
AdminConfig.save()

Problems SourceTree listing files in local repository as deleted

We are two developers working on a large project which involves 30 small satelllite web sites from two differente stations. We have been experiencing problems with SourceTree in the sense that sometimes in the OSX station the area "Work Copy Changes" lists many files as deleted and reques
A. Main issue:
Sometimes, before committing or pushing any changes on the repository, on the MAC station SourceTree shows on the working changes area that many files have been deleted. But when we check if the files still exist on the project folder of the MAC, they are still there.
We cannot proceed to pull or pushing any more changes until we go file by file ignoring the changes for each file or we make another commit confirming the deletion of the files.
This seems to be happening erratically when one of us pushes changes onto the repository.
Although we don’t know if it may be related to this, another issue that has been happening as well is that the folders requested to be ignored on the gitignore file are not ignored.
B. Configuration
A Samsung laptop running on Windows 7 and a MAC with OSX
For managing (pushing, pulling, committing) contents on the repository, we are using the latest versions of SourceTree (1.5.2 for Windows and 1.9 for OSX)
We are using the same software for development (PhpStorm)
We are using one master repository and branch for managing all the changes on the satellites
The configuration of the GIT config files is below:
Windows station:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = dlaggit#dev.dreamit.de:lotto-satellites
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
OSX station:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remote "origin"]
url = dlaggit#dev.dreamit.de:lotto-satellites
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
C. What we have tried so far
Discarding the changes on the files. The problem has arisen again weeks later with different files
Reinstalling SourceTree and making the changes below (highlighted) to the git config file on the OSX machine:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = dlaggit#dev.dreamit.de:lotto-satellites
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
After trying the solution above, some of the files on the working copy changes area no longer appear as deleted but as modified (even though they had not been modified by us), some of them appear recently added and some remain as deleted. When we check the files in the local folder, the files are still there.
Thanks for any help you can provide.

rsyslog logging to multiple servers with different TLS configurations

Is it possible to have rsyslog log to multiple servers with different TLS configurations? We're currently logging to a local syslog server using the following:
$DefaultNetstreamDriver gtls
$DefaultNetstreamDriverCAFile /etc/pki/rsyslog/ca.pem
$DefaultNetstreamDriverCertFile /etc/pki/rsyslog/local-cert.pem
$DefaultNetstreamDriverKeyFile /etc/pki/rsyslog/local-key.pem
$ActionSendStreamDriverAuthMode anon
$ActionSendStreamDriverMode 1
*.* ##10.50.59.241:6514
We're now in the process of setting up logging to a third party and want to use TLS there as well. They state that we should set up rsyslog like this:
$DefaultNetstreamDriverCAFile /path/to/their/ca.crt
$ActionSendStreamDriver gtls
$ActionSendStreamDriverMode 1
$ActionSendStreamDriverAuthMode x509/name
$ActionSendStreamDriverPermittedPeer *.theirhost.theirdomain
*.* ##theirhost.theirdomain:6514
I figure that I can simply combine the CA's into a single file and set DefaultNetstreamDriverCAFile to that. But if I simply add the remaining second set of options to the bottom of my rsyslog.conf then the permitted peer causes a conflict with the first host. So is there any way to configure rsyslog (we're currently using 7.4.8) to use vastly different TLS setups to two different targets?
Well after a bunch of head-banging I figured this out on my own. First off, there's a bug in some versions of rsyslog that will prevent this from working (you'll never see a connection established to one or more of the target servers) so make sure you're using version 7.6 or later of rsyslog.
Make sure your CA file has any CA's needed for all targets listed in it. Order isn't important. Then your conf file should look something like this:
$DefaultNetstreamDriverCAFile /etc/pki/rsyslog/ca.pem
*.* action(type="omfwd"
protocol="tcp"
Target="10.50.59.241"
Port="6514"
StreamDriverMode="1"
StreamDriver="gtls"
StreamDriverAuthMode="anon"
)
*.* action(type="omfwd"
Protocol="tcp"
Target="some.other.host.com"
Port="6514"
StreamDriverMode="1"
StreamDriver="gtls"
StreamDriverAuthMode="x509/name"
StreamDriverPermittedPeers="*.some.other.host.com"
)

git, strange upstream entry which i cant get rid of

if i do
git remote -v
i get
origin https://..../foo.git (fetch)
origin https://..../foo.git (push)
upstream
this last upstream line there prevents me from adding a real upstream which i wanna merge from.
my config file looks like this:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = https://..../foo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
when i do
git fetch upstream
i get this error:
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
how can i get rid of that upstream?
Git has several scopes where config is set : system ($(prefix)/etc/gitconfig), global (~/.gitconfig) and local (.git/config of the current repository).
Since there is nothing about upstream in your local scope, you have to check the system and global scopes. It could simply be a write access permission to associated files.

Resources