How do I connect PyCharm to a remote docker registry? - python

I have pycharm installed on one server and have docker installed on another server.
I wish to connect PyCHarm to docker on the other server.
I have added the IP address and username and password of the server but the test connection fails.
What exactly do I enter into this configuration screen in PyCharm?
Is there a specific format of address I need to use?

Is the IP address/ address url needs to be a public one as specified here
Also keep in mind - the screen you are trying to put your details into is to add a custom docker registry details and not connect your server to another docker server. If you are trying to add a new custom registry, then great! otherwise you might want to have some ssh tunnelling to connect 2 servers.

Related

Can't connect to GCP VM website with external IP

Trying to connect to my django website (from the browser) that's stored on the GCP virtual machine.
Everything works fine if I'm accessing it internally using internal IP or localhost.
However, I can't access website with external IP.
No logs in django that would say someone trying to access if I'm trying with external IP.
I have http, https traffic enabled on instance.
Firewall rule to allow port 80:
Here is Test-Net results.
Searched the web for answers but nothing looks wrong in my settings..
Any ideas would be appreciated.
UPDATE:
Do not create or change egress rules unless you know exactly what they do. They are not necessary for ingress rules (VPC Firewalls automatically allow return traffic):
I've changed all firewall rules back how they were so now only port 80 is allowed.
You have an ingress rule for the target http-server. Is that target flag set on the VM instance?
What is the output from sudo lsof -i -P -n | grep LISTEN? Your Django server must be listening on 0.0.0.0.0 instead of localhost.
I have 0.0.0.0 with port 80 at django terminal.
I use windows 2016 server so don't know the powershell function that would display what you asked for.
Here is netstat listening ports for django.

Host a Django project on Apache2 locally

I have finished a Django project and want to deploy it over Apache2 locally over LAN. I have figured out how to connect Django with Apache2 using mod_wsgi and it worked great because I was able to use Apace2 to actually host Django on localhost.
Now I want to actually make this project available to anyone on my local network. Like for instance assuming that my local IP address was 10.10.10.51 I could go to a different device connected to my local network and type in 10.10.10.51 to actually get to the Apache2 server homepage. It does that successfully.
My Django project is hosted on my Apache2 localhost server at djangoproject.localhost and it works fine just on my PC. When I move on to the other PC and go to djangoproject.localhost the site is not up there. Yes they are both connected to the same LAN network.
I used this tutorial to host Django on Apache2: Host Django on Apache2 with mod_wsgi
I think that you have to configure something called port forwarding in your home modem, this video could help: https://www.youtube.com/watch?v=6gkoDQUQSLc
I suppose you are on windows ...
If you run your app on pc1 and want to call it from pc2, you need to call it either
via ip adress of pc1
via djangoproject.localhost
but then you need to edit the hosts file on pc2:
C:\Windows\System32\drivers\etc\hosts
and add something like (x.x.x.x = ip adress of pc1)
x.x.x.x djangoproject.localhost
because on pc2 your brwoser does not know what to do with djangoproject.localhost as in a LAN in general you do not have a local domain name server running.
If your firewall on pc1 blocks access to apache you need to got to "windows defender firewall" (type "defender" in search bar) and add a rule for apache application.

Connect to vm with run pwsh on target machine task and getting error "The SSL certificate contains a common name that does not match the hostname"

I am trying to connect to vm using run powershell on target machine task using classic editor to trigger a python code which needs to be downloaded from artifact on the target machine (here, vm).
I am getting an error " The SSL certificate contains a common name (CN) that does not match the hostname. "
I have tried to change settings in certificate snap-in but it still gave me same error.
Thank you #VenkateshDodda-MT & #srbrills Posting your suggestion as an answer to help other community members.
The server certificate on the TARGET system, not the host file or the build agent, is the problem. 
The problem happens when you build an Azure VM without a DNS Name Label for your public IP and then add one afterwards (something like example.centralus.cloudapp.azure.com). It can also happen if the DNS name label is changed.
You need to make sure that, what address you want to use to connect to the machine. This is the target machine address.
On the target machine, open PowerShell as an administrator. Enter the following command.
New-SelfSignedCertificate -DnsName WhateverTargetMachineAddressYouNeed -CertStoreLocation Cert:\LocalMachine\My
Enter the following commands one at a time in PowerShell.
winrm delete winrm/config/listener?Address=*+Transport=HTTPS
Then:
winrm create winrm/config/listener?Address=*+Transport=HTTPS '#{Hostname="WhateverTargetMachineAddressYouNeed";CertificateThumbprint="TheThumbprintYouCopied";port="5986"}'
For more information please refer this SO THREAD & Configure WinRM to execute PowerShell Script on a remote Azure machine with ARM

Django - Host a website on a Lan Network

I've been working on a website for the past month, and now its time for me to host the django website onto a private server. Is there a detailed method on how I'm supposed to host the website onto a specific IP address assigned to my system?
This is my first time dealing with hosting a server and i dont know much about it.
Also, once i host it, How do i change the link from being the IP address to an actual link like "12345678.com" or something like that?
(The website should be hosted in such a way that only the people who are in the same network/lan connection should have access to the website.)
I have wamp on the system and the system has a Windows Server OS (if this info helps)
you can run your codes with manage command like this
python manage.py runserver 0.0.0.0:8000
but its strongly recommended to run your code with a web server like nginx or apache read this tutorial to run your site on a linux server
https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-ubuntu-14-04
on windows you can use IIS but its not recommended. its performance is not good
to use 1234567890.com instead of using server ip address you must setup a DNS server on your local network. in linux you can use bind and windows server have its own DNS server. but in your DHCP configuration you must set this DNS server as clients DNS.

Programmatically get IP address of vm in Vagrant

I'm trying to create a rest api which can launch, provision and destroy vagrant boxes.
So far I've managed to do most of the easy tasks such as provisioning, parsing logs to determine if provisioning was successfull, starting, stopping, destroying vms and parsing logs to find when a port was conflicting and has been remapped.
However, I can't figure out how to get around finding the new ip the box received from the router's DHCP.
I could run
vagrant ssh -c ifconfig
and try to parse the ip address but if i don't know the interface name it won't work.
Is there a way to have vagrant report what is it's local ip? alternatively is there a way to find this ip otherwise?
I'm using python-vagrant to interface python with vagrant but at this point even executing shell commands through python would be acceptable.
Thanks
You can tell the Vagrant to use a specific IP instead on getting a random one by adding
Vagrant.configure('2') do |config|
config.vm.network :private_network, ip: '192.168.x.x'
end
You should already have the Vagrant.configure section and this will provision the box using the specific IP you define.

Categories

Resources