Log4j-Audit Getting Started fails for Catalog Editor - log4j

Was doing the Log4J-Audit getting started at https://logging.apache.org/log4j-audit/latest/gettingStarted.html
In the Catalog Editor section found some problems:
Download jar url was incorrect, missing "log4j-audit" folder
wget url was incorrect, had an extra 1.0.1 folder
git remote -v was set to ${remoteRepoUrl} instead of actual http://github.com/etc address. And the repo was not pulled. The .git folder was found but the git pull never happened. I think this might be related to proxy server but not sure if git supports a Variable.
Am I doing it wrong or are the instructions incorrect?
Where can I report such a problem?
In the end, I manually changed the
git remote set-url origin http://github.com/etc
did a manual git pull, and then the UI finally came up.

So, #1 and #2 are still a problem.
Because I have a corporate proxy server which also requires a user/password
3 was solved with adding system env vars like this
java -Dhttps.proxyHost=myProxyServer -Dhttps.proxyPort=8080 -jar log4j-catalog-editor-1.0.1.jar
It does seem that the sun.net.HTTPSClient class which is called, does not mention using Basic Auth so not convinced why it works.
A new thing I found in the Getting Started tutorial is that it's important to change the branch=master in the application.properties.

Related

git pull with access token, git push with username / password

I've got a problem with git push. Here are many threads regarding this issue, but none of them fit to my problem.
The company I work for, has it's own gitlab. Policy is only https, no ssh is allowed. For cloning and pulling, an access token is required. Pushing only with username/password. Don't ask me about the underlaying reason. Unfortunately I don't know it.
Error message is:
$ git push
fatal: unable to access 'https://<username>:<AccessToken>#<domain>/<owner>/<reponame>.git/': The requested URL returned error: 403
At least I alread was able to clone a repo, but I'm failing to push the changed content respectively. Ubuntu 18.04 is running on my laptop.
What do I need to do to solve my issue?
You already know that every remote stores a URL: origin literally means https://<username>:<AccessToken>#<domain>/<owner>/<reponame>.git/.
What you didn't know is that every remote actually stores two URLs. One is used for git fetch, and the second one is used for push. The second URL defaults to being the same as the first URL, but if you set it, you can set it to anything else, such as the URL without the access token. To set the second URL, you can use git remote set-url --push:
git remote set-url --push origin <url>
If you're like me, you might want to know about git config --edit as well, which will open the configuration file (typically just .git/config) in the same editor you're having Git use for everything else, where you can just edit it directly. But git remote is the tool designed for fiddling with the settings attached to each remote-name.

hg-ssh - cannot clone repository, but pull/push works

I am trying to setup a new mercurial server (first time for me), serving with hg-ssh and am running into the problem that I can pull and push, but not clone a repository to the server.
In .ssh/authorized_keys on the server, I have the following line before the key:
no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=".../hg-ssh
repos/*"
Without this line, cloning the repository works, so it's not a path issue.
I am somewhat baffled by this, because I would have expected hg-ssh to allow for cloning - am I wrong in assuming this?
Is there some config I might have missed?
I was unable to determine from the documentation whether hg-ssh should allow cloning to the server.
What I have done is change the line
command=".../hg-ssh repos/*"
to
command="[path]/allowed-commands.sh
and implemented the script following https://serverfault.com/a/803873, redirecting all 'hg init' calls to hg directly, while redirecting all pull/push requests to hg-ssh.
This works fine for pull/push and clone.

Error occurring in localhost but not on my website even though the code is the same - how?

I am getting an error on a form submit in localhost, but no errors on my live website.
The error is: Error: Can't set headers after they are sent.
I ran git diff to see the differences between my remote and local repos, and there were some since I had made a couple of changes. Those changes were: adding a custom bootstrap configuration (I wanted to change the base font from 14 to 18px) and uninstalling New Relic, an npm package for analytics. I am not sure how any of that would have caused the error, I am just trying to explain thoroughly.
My remote git repository is the code behind my live site, which is not getting this error, so I decided to make my local files match my remote, so I ran:
git fetch origin
git reset --hard origin/master
git clean -f
and then ran git diff again and there were no differences this time. That is what is puzzling to me. It seems like there should be no difference. Thanks in advance for any tips.
As a result of some earlier testing I had created duplicate usernames, and this error is only occurring when logged in with one of the duplicates, which only exist in my local DB. That explains why I was getting this error in localhost and not in my live site.

GitHub SSH access not working

I have created a new user on github under our organization which will be used for auto deployment. I followed the article on https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-linux.
Somehow, when I tried to clone the repository to the server, it worked once. The code was running properly, and I exit the server. Today, we released an update to the code, and I wanted to deploy the code manually to the server, so I ssh'd into the server and tried to pull the repository with git pull. It gave me Permission denied error. After some debugging I realized that the ssh-agent wasn't running. So I executed the following commands:
eval "$(ssh-agent -s)"
ssh-add .ssh/id_rsa_staging
Now, when I try ssh -T git#github.com, I see the welcome message which is:
Hi *****! You've successfully authenticated, but GitHub does not provide shell access.
But when I try to pull from the repository, I am continuously getting this error message:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I checked the repository and the user has read access to it. I double checked if the keys match on github and server, yes they do. I tried generating new keys. I tried using ssh/config file. Nothing helped...
I appreciate any help & suggestions!
Update:
So I figured out that git clone command is working properly, but even when I try git pull right after git clone, it is giving the error.
If you are using sudo to git pull/push to the remote you need to ensure you used sudo to generate your SSH keys. Otherwise you will not be using the same keys that you originally generated.
github doc for reference
I had the exact same issue.
For me what worked was
Go to repo on github which you have cloned and wanna pull with
Under the code-download option copy SSH link
Enter following command in your terminal -->
git remote set-url origin paste_SSH_link

How can I get git to work with a remote server?

I am the CM person for a small company that just started using Git. We have two Git repositories currently hosted on a Windows box that is our all-purpose Windows server. But, we just set up a dedicated server for our CM software on an Ubuntu Linux server named "Callisto".
So I created a test Git repository on Callisto. I gave its directory all of the proper permissions recursively. I had the sysadmin create a login for me on Callisto, and I created a key to use for logging in via SSH. I set up my key to use a passphrase; I don't know if that could be contributing to my problems? Anyway, I know my SSH login works because I tested it through puTTY.
But, even after hours of trials and head scratching, I can't get my Windows Git bash (mSysGit) to talk to Callisto for the purposes of pushing or pulling Callisto's git repository files.
I keep getting "Fatal error. The remote end hung up unexpectedly." And I've even gotten the error that Git doesn't recognize the test repository on Callisto as a git repository. I read online that the "Fatal error...hung up unexpectedly" is usually a problem with the server connection or permissions. So what am I missing or overlooking here? And why doesn't a pull using the git:// protocol work, since that only uses read-only access? Group and public permissions for the git repository's directory on Callisto are set to read and execute, but not write.
If anyone could help, I would be so grateful. Thank you.
If you use putty/pageant, check if your host is in the know_hosts file in
docssettings/userdir/.ssh
If not, try putty first and accept the key your server provides.
Do you have similar lines in .git/config?
[remote "origin"]
url = ssh://user#server/.../repo.git
I have only passing familiarity with mSysGit, but I don't think it installs an ssh client. Without the ssh client, git cannot connect to the server. (This functionality isn't baked into git as per the Unix philosophy.) As for the git protocol, unless the server has that enabled, it won't work. Since it seems you have the server setup for ssh access, I doubt you'll get anywhere with the git protocol.
Anyway, I know my SSH login works
because I tested it through puTTY.
Have you confirmed that you can SSH to the server from your msysgit client?
i.e. what happens when you ssh user#callisto.com from the msysgit command line?
For further details about setting up your git server, you may want to review Pro Git: Chapter 4 "Git on the Server".
And why doesn't a pull using the
git:// protocol work, since that only
uses read-only access?
For the git protocol to work, you must setup the git daemon on your server as described in Chapter 4.9 of Pro Git.
You may also want to take a look at this answer to a related SO question. It has a more detailed checklist of things to consider.

Resources