How do I use Bazaar with a HTTP proxy? - bazaar

How do I use Bazaar with a HTTP proxy? I can't find anything in their documentation.

Set the http_proxy environment variable to point to your proxy, eg. (on Windows):
set http_proxy=http://webcache.mycompany.com:3128/
See the "Environment variables" section of http://bazaar-vcs.org/ConfiguringBzr

Also do not forget to set HTTPS_PROXY environment variable.
set https_proxy=http://my.proxy.com:3128/

I post this answer as a reference for those who may later visit this page.
If you still have trouble with proxy connection after trying all the other methods, try setting your proxy settings using dconf and gconf editors.
Note:
The settings that the latest programs are expected to use are the DConf settings but some old programs might still use GConf settings, so it is wise to set your proxy settings in both.
If not already installed, you can easily install dconf and gconf editors from synaptic or the package manager of your distribution.
Proxy Settings:
In your Conf dconf editor traverse to
system > proxy
There you should see the options for setting your ftp, http, https, socks proxy settings.
Note:
In case your proxy needs authentication, and your password contains special characters like# you would know by now (after painstaking searches), that you should replace your # with %40 (the HTML character encoding for #) while configuring your proxy settings, eg. in ~/.bashrc.
Do not follow this practice in the configuration editor. Type your password as it is.
Now, in case of gconf editor, the path to the proxy settings is same, but the options might be a bit different. But, I am sure you can make it out.

Related

Apache Security settings - unsure of where to find in Config file

This is my first post under the Apache tag, so not sure if I have posted it in the correct spot. Apologies if it's not.
We recently had an audit done on our Apache server. It's running on a Windows Server 2012 R2, and I installed Apache 2.4.27 through WAMP.
The results from the Audit are fairly specific, but I don't know where to go in the Config file to fix these. My IMIT department has gone through a number of changes and we no longer have someone who can help me, so I'm stuck.
The three areas I need to correct are:
1) MISSING SECURITY HEADERS Recommendation: Implement HTTP security headers in the web applications to prevent exploitation of vulnerabilities.
2) Recommendation: Make sure that browsable directories do not leak confidential informative or give access to sensitive resources. Additionally, use access restrictions or disable directory indexing for any that do.
3) The remote web server supports the TRACE and/or TRACK methods. TRACE and TRACK are HTTP methods that are used to debug web server connections. Recommendation: Disable these methods.
I have looked in the config and in various documentation online but the Windows install for Apache seems to be unique, and I don't want to risk screwing up something that breaks the install.
Any ideas would be greatly appreciated.
Chris
Find httpd.conf file. It should be in the conf folder in the localization where Apache is installed like for ex:
C:/Apache/Apache/conf/httpd.conf
If you're not sure where that is - open task manager, find httpd.exe and check it's properties.
Then add required configuration there.
Check out this helpful github:
https://github.com/h5bp/server-configs-apache/blob/master/dist/.htaccess
You can check your configuration files for syntax errors without starting the server by using apachectl configtest or the -t command line option.

Change Intellij HTTP proxy from command line

According to our company policy we need to change password regularly, which means I have to update the proxy authentication password.
I have a script that solves all of this, except for the Intellij proxy setting.
Therefor, my question is: Is it possible to change Intellij IDEA's HTTP proxy setting from the command line?
The setting I'm refering to is Appearance & Behavior > System Settings > HTTP Proxy in Intellij.
I'm using IntelliJ IDEA 2016.2.4
No there is not. The password value is stored in the file .IntelliJIdea/config/options/proxy.settings.pwd but it is encrypted. Otherwise your script could modify it. You might be able to dig through the source code and see how the encryption works to see if you can replicate it in your script.

SonarQube: weak ephemeral Diffie-Hellman key issue with SSL

How do we by pass this issue with SonarQube server v5.1 and firefox? Chrome & IE are working fine but firefox is not allowing to access the server in https mode. I looked at https://weakdh.org/sysadmin.html but I am not sure what server SonarQube uses and how to implement fix for this problem. Any help is appreciated. Thanks.
When a user wants to enable (or restrict) access to a SonarQube instance over HTTPS, the recommended way is to put it behind another WebServer she configures at will.
So, the way to go here, is to add an Apache, Nginx or whatever in front of the SQ instance and configure it according to the recommendations in the link you provided and generate a "safe" server certificate.
I fixed it by setting the following property in sonar.properties file.
sonar.web.https.ciphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA

Changing Bugzilla url

I have installed Bugzilla with Apache on a Windows machine. The Bugzilla web application is set to http://localhost but i have to move it to http://localhost/bugzilla . I think that the Apache server must have a configuration file somewhere but i have little experience with it. Anyone had this problem?
You don't necessarily need to reconfigure Apache, but here's how you would do it:
http://httpd.apache.org/docs/current/platform/windows.html
What you do need to change is the urlbase parameter that tells Bugzilla how to form links to other pages. Yours is probably set to http://localhost/ at present; you probably want it to be http://localhost/bugzilla/.
See http://www.bugzilla.org/docs/4.0/en/html/parameters.html for what you can configure.
If you can't get Bugzilla to load at all, look for a file name params.pl and change the value of urlbase manually. You noramally s

Make Maven Proxy/Server settings configurable based on location?

So I'm not sure what the best way to accomplish this is, but basically I have a laptop that I use at work for Maven projects. It works fine when I'm at work, but as soon as I walk out of the door of their corporate proxy and maven server, I often have to do alot of hand-fudging of the settings.xml file when I'm at home if I'm not VPN'ed in:
We have a corporate-installed Maven Repository proxy server to store some of our own artifacts and handle being the middle-man for our commonly used artifacts.
We have an http proxy that we use for connecting to the outside world.
Both configurations have been handled by my settings.xml file for setting a single Nexus group and maven proxies. If I'm not connected to the VPN while away from the office, I have to muck around with the settings.xml each time I'm not on it, then switch it back when I am on it.
What solutions have anyone else found to handle this? I've been trying profiles to manage the proxy, but I can't seem to get it to work correctly, and it's starting to look pretty ugly. Are there some settings configurations that can detect when I'm not behind the proxy at work and not use the corporate proxy server or Maven server?
While I can think of some profile based solution to handle the proxy (basically, reading the <active> value from a property defined in a profile), this wouldn't be fully automated (the profile activation do not support network based stuff) unless you can find a file that is present or not depending on your location (in which case, you could use an existing/missing file trigger but this is kinda hacky). Anyway, this would solve only one part of the problem because mirrors can't be declared in profiles (see MNG-3525).
So, instead of trying to control this with a profile, my suggestion would be to use two settings.xml and to pass your settings-home.xml file with the -s command line option when you're at home.
Another option would be to automate the changes in your settings.xml with a script (Groovy would be a good choice as someone reported in MNG-3525).
I found a use environment variables to set nonProxyHosts together with proxy and noproxy shell aliases to be the most convenient solution when switching between networks with proxy and without it.
In settings.xml, configure proxy with
<host>proxy.corporation.int</host>
<port>8080</port>
<nonProxyHosts>${env.MAVEN_NONPROXY}</nonProxyHosts>
Then in ~/.profile set
export MAVEN_NONPROXY_PROXY='*.corporation.int|local.net|some.host.com'
export MAVEN_NONPROXY_NOPROXY='*'
alias proxy="export MAVEN_NONPROXY=\"$MAVEN_NONPROXY_PROXY\" && export all_proxy=http://proxy.corporation.int:8080"
alias noproxy="export MAVEN_NONPROXY=\"$MAVEN_NONPROXY_NOPROXY\" && unset all_proxy"
To do the switch when roaming, you would just execute from a shell:
[me#linuxbox me]$ proxy
or
[me#linuxbox me]$ noproxy
Obviously, both aliases proxy and noproxy can include much more changes than just setup of MAVEN_NOPROXY and all_proxy.
I was frustrated by the same problem: having to manually edit settings.xml when roaming between networks. So much in fact, that I wrote a Maven plugin that enables automatic discovery of proxy settings. The current implementation uses the proxy-vole library written by Bernd Rosstauscher to detect proxy settings based on OS configuration, browser, and environment settings.
I've just released the source code of the plugin on Github, under an Apache 2.0 license: https://github.com/volkertb/autoproxy-maven-plugin
You're welcome to give it a try and to see if it meets your needs. Any feedback or contributions are welcome!
(Note: you don't necessarily have to add the plugin to your project's POM. You can invoke it from the command line as well, after you've installed it. See the README on the site for more details.)
You can set MAVEN_OPTS when you need to activate a proxy:
export MAVEN_OPTS="-Dhttp.proxyHost=my-proxy-server -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=*.my.org -Dhttps.proxyHost=my-proxy-server -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=*.my.org"