GitHub, Linux Server and Ownership Issues - linux

I've got a private Git repo on GitHub and I have setup SSH connections between my server and github.com. I can pull my app from GitHub successfully on to the server but when I visit my app URL I get a '500 Internal Server Error'. My host suggests that this is to do with ownership problems.
So my question is this, if I am logged in to my server via SSH as root, and I do a pull request, how can I make sure that the ownership of the files on the server are correct.
Thanks

Related

control gitlab traffic using haproxy

We have a gitlab instance that is running in a private subnet in AWS. For some of our projects we need to be able to clone them and execute some pull commands from outside our network. We want to control the acces to this repositories through haproxy and give restricted acces to them. We are cloning them through https, so we do not need ssh trafic forward for them. The problem is that i have setup the rules to fwd the request for a specific repository to gitlab but every time i try to login i get :
remote: HTTP Basic: Access denied
fatal: Authentication failed for ...
The rule is something simple like :
use_backend gitlab if { path_beg /path1/path2/repo.git }
Our backend definition looks like :
backend gitlab
mode http
server gitlab git.internal.server:80
Anyone managed to this thing using haproxy ?

How to open localhost:8000 using VPS Ubuntu

hello I need help how to open http://localhost:8000 from my pc. because my project polkadot substrate installed on a VPS Ubuntu, after I try to open IP:8000 it also doesn't work
Images
You have to run the substrate node using --rpc-cors all option. Please note that substrate chains don't expose websocket connections to the public internet without some hacking. I am assuming your question asks how to connect a substrate node running on a remote server to your local pc front end. If that's right let's continue:
https://wiki.polkadot.network/docs/maintain-wss
Describes the entire process. You need to install NGINX, configure /etc/nginx/nginx.conf and within the http code block insert the mentioned code, with proper variable replacements. Then generate a self-signed SSL certificate, and open port 9944 and 443 on your remote machine. Next visit the machine with https://IP:443 to whitelist that site, and finally connect to your substrate node with a local installation of polkadot-js-apps. You cannot connect it using the online polkadot.js explorer , so you must use a local connection. And that should get you up and running.

git clone failed to begin relaying via HTTP

When Using git clone, I come into an error.
Here is the command and the error information.
[user#linux]$ git clone git#github.com:username/repertory.git
FATAL: failed to begin relaying via HTTP.
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Except for git#github, git clone https://...... and git clone git://...... works well. So i guess there is something wrong with ssh protocal, then i checked ssh.
[user#linux]$ ssh -T git#github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
It seems that I can connect to github through ssh protocol properly. But what's wrong with git clone through ssh?
This error message comes from connect.c from SSH
It is a SSH Proxy Command -- connect.c, the simple relaying command to make network connection via SOCKS and https proxy: You can make SSH session beyond the firewall with this command.
So check if such a connection is needed: it could very well be needed if you are in an enterprise, behind firewall, but in that case do contact your IT support team to check the validity/approval of such a solution.
And that error message indicates that even this SSH mode (relay through https proxy) might be blocked.
If you are not in an enterprise setting, and don't need proxy, do remove them (HTTPS(S)/PROXY) from your environment variables and your git config file.
If you're using a Proxy, many corporate firewalls block access to the CONNECT method on ports other than 443. GitHub operates an SSH server listening on port 443, using the host "ssh.github.com".
First, configure your SSH ~/.ssh/config with the following:
Host github.com, ssh.github.com
User git
Hostname ssh.github.com
Port 443
ProxyCommand socat - PROXY:localhost:%h:%p,proxyport=3128
in the example above I'm assuming you're running a web proxy on host localhost and port 3128 (e.g. cntlm).
You may also substitute socat with nc or connect-proxy with slightly different syntax.
Test with:
ssh -T git#ssh.github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
then with:
git clone git#ssh.github.com:username/repository.git

How can I access my nodejs web server from my local computer using the server domain name?

I installed nodejs and created a sample app. When I run npm start I get a message saying that I can open my web browser to http://localhost:3000 to see the app in action, but this installation is on a web server - not my local computer, so, instead of localhost:3000 I want to get there using something like mydomain.com:3000
I can't find the answer, it's very likely I just don't know how to search for it... any ideas?
I'm following the tutorial here: https://facebook.github.io/react/tutorial/tutorial.html
I think I only needed to get away from this for a while. I got it working using ssh local forwarding.
I already used an ssh config file to log in to my server without having to remember the password, so I just added this line to my config file:
LocalForward localhost:3000 xxx.xxx.xxx.xxx:3000
where xxx.xxx.xxx.xxx is my server IP address.
Then, I connected to my server via ssh:
ssh -f -N mysite
Once connected, I open up the browser and go to localhost:3000 and there it is now.
I used my ssh config file, but it should also work without it.
ssh -f -N -R 3000:localhost:3000 mydomain.com
I found this command that eventually led me to solve my problem in this link: http://stuff-things.net/2016/01/20/tunneling-to-localhost/

hgweb server abort: HTTP Error 404: Condition Intercepted

I have set up an http server with the hgweb.cgi cgi script in a Linux server.
I put up a mercurial repository in the server. I can clone the repository from a windows machine without any problems. I can view the server in any browser. I can clone the repository from my localhost: (the server)
hg clone http:// localhost /hg/proj
works perfectly.
But when I tried to access the server on another Linux machine I got this error message:
hg clone http://myhgserver/hg/proj
abort: HTTP Error 404: Condition Intercepted
I could not find any error message in the error_log file on the apache2 web server.
First I suspected that I am using an older version of hg on my client side (1.4).
My server side is hg 2.6.3.
Then I tied to install the latest mercurial in my home directory (I have no permission the system directories)
I used the "make local" command to install the mercurial package locally.
./hg --version
Mercurial Distributed SCM (version 3.0+4-75aaae8ad660+20140613)
The clonning command gave the same error:
abort: HTTP Error 404: Condition Intercepted
I have spend almost the whole day, and now it is mid night, still could not find any answer.
Anyone else has seen such a problem?
Kemin
After a night of sleep, I got my problem resolved.
Basically, the hg program is missing the ability to resolve hostname into IP addresses.
Since my server and client computers are on the same LAN, there is no connection or firewall problems.
I can PING from my client to my server without any problems. I can run the host command:
host myhgserver it will give you the whole IP address and the fully qualified domain names. If I used the IP address instead of the host short name, then hg works fine.
What I think is needed is to add a few lines of code to hg client program so that it can find the server from an alias.

Resources