GitHub - how do I push? - github

Whenever I try to push, GitHub hangs for a while (~a minute) before outputting:
ssh: connect to host gmail.com port 22: Bad file number
fatal: The remote end hung up unexpectedly
I checked my SSH keys a few times. I was able to ssh github.com and when I do it asks me for my passphrase and then says, "Hi Aro! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed"
First of all, why is it trying to gmail.com when I am using git push? Why is it timing out if the ssh keys seem to be working? I don't see any firewall alerts. I don't think my router is blocking anything. I'm on Windows 7.
What do you think is the problem?
.git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = my#email.com:MyGithubUsername/Hello.git
fetch = +refs/heads/*:refs/remotes/origin/*

Under [remote "origin"], the url value should be changed:
[remote "origin"]
url = git#github.com:MyGithubUsername/Hello.git
The authentication is purely done on the basis of keys, not the username or email address.

Related

Airflow- configure smtp with office365 without credentials

When a task/DAG fails I want to send an email to someone, and this does not work. We are using Office365 for this within the organisation and there should not be a need to authenticate with credentials user or password, as it is not done in other running projects. We are using the latest Airflow version released: 2.1.4
I have tried with the configuration in airflow config:
[email]
email_backend = airflow.utils.email.send_email_smtp
email_conn_id = smtp_default
default_email_on_retry = True
default_email_on_failure = True
[smtp]
smtp_host = <the smtp host(Office365)>
smtp_starttls = True
smtp_ssl = False
smtp_port = 25
smtp_mail_from = <the from email>
smtp_timeout = 30
smtp_retry_limit = 5
As I try this I get the following error in the airflow log when a task fails:
WARNING - section/key [smtp/smtp_user] not found in config
...
ERROR - Failed to send email to: ['<my email>']
Therefore I suppose I need to have a user if I use these options in the config.
There is also this information in the log:
PendingDeprecationWarning: Fetching SMTP credentials from configuration variables will be deprecated in a future release. Please set credentials using a connection instead.
I have been looking at this airflow documentation:
https://airflow.apache.org/docs/apache-airflow/stable/howto/email-config.html
But it does not help me to understand how I should set up a connection to our smtp-server that is with Office365. The problem is as well that I don't have a user or password. I could possibly get them, but as it works without them in other running projects I am looking to do something similar.
Does anybody have some guidance in this matter?
Thank you
I have two client setup SMTP with authorizaiton, just setup as manual then work. My new client, their mail relay have no need to authenticate with user or password, I just config empty string as folow then works.
It will left PendingDeprecationWarning in log.
[smtp]
...
smtp_starttls = False
smtp_ssl = False
smtp_user =
smtp_password =

Spring cloud config - Remote hung up unexpectedly

I am trying to connect to private gitlab self hosted service with ssh key.
Following is the yaml config
spring:
cloud:
config:
server:
git:
uri: git#gitlab.devops.mhealth.tech:shivhg/config_src.git
ignoreLocalSshSettings: true
host-key: shiva.kumar#mhealth.tech
strictHostKeyChecking: false
hostKey: someHostKey
hostKeyAlgorithm: ssh-rsa
privateKey: |
Also tried .ssh/config update
StrictHostKeyChecking no
PreferredAuthentications publickey
IdentitiesOnly yes
IdentityFile ~/.ssh/***private
ServerAliveInterval 60
ServerAliveCountMax 5
Receiving exact same error as #1447 tried the suggestions provided there as well.
Tried in intellij also in iterm console.
Some pointers to fixing this would be helpful, thanks in advance

How to configure github with proxy?

I am running through a proxy and i do not understand how to make git work.If i try to clone a repo i get the following error:
$ git clone https://github.com/somerepo
Cloning into '[something]'... fatal: unable to access
'https://github.com/somerepo': OpenSSL SSL_connect:
SSL_ERROR_SYSCALL in connection to github.com:443
I have already tried most of what it is saying here changing the git global and checked this SO thread too to no avail.
I have also tried to unset proxy for http and https.
Looking in my git config it looks like this:
[user]
name = Adri
email = [some_address]#outlook.com
[http]
sslBackend = openssl
sslCAInfo = C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem
[remote "origin"]
proxy =
Could this be a problem ?
P.S I get this problem for all git operations, i can't clone,pull,push etc.. and for all repositories.

Where did the 'Regster new email' button go?

I've setup my own test Gerrit server. I've been able to register my email address and make a couple of commits. However, I deleted my email address in order to get another confirmation email from my server, since I wanted to test the tweak I made to the SMTP server configuration. Going back to my Settings page on the GUI, I noticed the 'Register new email' button had vanished, as pictured below.
Though the email appears in the drop-down box, my email address was deleted, since 1) Settings > Identities does not show any email address, and 2) when I try to 'Edit config' on a Project, the GUI pops up the message:
I've also tried adding the email using the ssh shell, since I'm admin:
$ ssh -p 29418 myUsername#my.server.com gerrit set-account myUsername --add-email foo#bar.com
fatal: realm does not allow adding emails
What's the matter?
EDIT : Here is my etc/gerrit.config file. Yes, I've restarted Gerrit after I've changed it. For sendemail configuration, I've also tried setting the port to 465 and encryption to ssl and restart Gerrit, but it's still the same.
[gerrit]
basePath = git
serverId = [alphanumeric string]
canonicalWebUrl = http://my.server.com:8012/
[database]
type = h2
database = /home/gerrit2/gerrit/db/ReviewDB
[auth]
type = OAUTH
[receive]
enableSignedPush = false
[user]
name = gerrit2
email = foo.noreply#gmail.com
[sendemail]
from = USER
smtpServer = smtp.gmail.com
smtpServerPort = 587
smtpEncryption = tls
smtpUser = foo.noreply#gmail.com
smtpPass = [foo.noreply#gmail.com 's Pass]
sslVerify = false
[container]
user = root
javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8012/
[cache]
directory = cache
[plugin "gerrit-oauth-provider-google-oauth"]
client-id = [Google client ID]
link-to-existing-openid-accounts = true
[plugin "gerrit-oauth-provider-github-oauth"]
client-id = [GitHub client ID]
[plugin "gerrit-oauth-provider-bitbucket-oauth"]
client-id = [BitBucket client ID]
When
auth.type = OAUTH
You need to add explicitly
[oauth]
allowRegisterNewEmail = true
https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#oauth.allowRegisterNewEmail

Error using Google two factor auth with mu4e & Gmail

I have been using Google 2 factor auth for a while, and have several applications configured. One of them is offlineimap (where I download the mail), but when I use mu4e to compose a message, I get the following error:
Sending failed: 534-5.7.9 Application-specific password required.
Learn more at 534-5.7.9
http://support.google.com/accounts/bin/answer.py?answer=185833
I have a ~/.authinfo.gpg configured (and it decrypts successfully manually), and my ~/.offlineimaprc calls get_password_emacs (the example I used can be found here).
I've even attempted to skip the gpg piece to see if it works, using my mu4e Google App Password directly in the ~/.offlineimaprc, but I end up with the same result.
My ~/.authinfo.gpg file: (decrypted here, sensitive info removed)
machine imap.gmail.com login me#gmail.com port 993 password GoogleAppPassword
machine smtp.gmail.com login me#gmail.com port 587 password GoogleAppPassword
My ~/.offlineimaprc file:
[general]
accounts = Gmail
maxsyncaccounts = 3
pythonfile = ~/.offlineimap.py
[Account Gmail]
localrepository = Local
remoterepository = Remote
[Repository Local]
type = Maildir
localfolders = ~/Maildir
[Repository Remote]
remotehost = imap.gmail.com
remoteuser = me#gmail.com
remotepasseval = get_password_emacs("imap.gmail.com", "me#gmail.com", "993")
ssl = yes
maxconnections = 1
realdelete = no
holdconnectionopen = true
keepalive = 60
type = IMAP
and my ~/.offlineimap.py
#!/usr/bin/python
import re, os
def get_password_emacs(machine, login, port):
s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
p = re.compile(s)
authinfo = os.popen("gpg -q --no-tty -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
Can anyone see the issue I'm having? I've validated that the ~/.authinfo.gpg file decrypts successfully, and that my Google App Password is correct.
Thanks for your time.
using my mu4e Google App Password directly in the ~/.offlineimaprc
That's exactly the problem. You shouldn't be using the password directly. For legacy applications that do not accept the second factor token, you need to use the application-specific password, instead. This is a password that you generate from this URL:
https://security.google.com/settings/security/apppasswords
And you use the generated password in lieue of your real password. You should note, however, that these application-specific passwords grant full access to your account. As a result, using app passwords significantly reduces the protections you get from enabling 2-factor on your account.