How to use fastlane behind proxy - fastlane

I can't find any option about fastlane to set the proxy. So does there has a direct way to solve this?
Thanks very much for any help!

I had the same problem and for me this site helped as fastlane is using Faraday internally. You have to set up the proxy environment variables for faraday with the following commands:
$ export http_proxy="http://proxy_host:proxy_port"
$ export https_proxy="https://proxy_host:proxy_port"

Any of the Fastlane tools that use spaceship (i.e. the Apple APIs) can be proxied using a combination of three environment variables.
SPACESHIP_PROXY: set the http proxy to use (SPACESHIP_PROXY =https://localhost:9090)
SPACESHIP_PROXY_SSL_VERIFY_NONE: when present, disables SSL verification (to allow inspecting HTTPS requests)
SPACESHIP_DEBUG: equivalent to SPACESHIP_PROXY=https://127.0.0.1:8888 SPACESHIP_PROXY_SSL_VERIFY_NONE=1, preconfigured for Charles Proxy defaults.
To use these, set them as environment variables in your shell, or prepend them to any fastlane command. For example, SPACESHIP_PROXY=https://localhost:9090 bundle exec fastlane
Source: Spaceship debugging documentation

Related

Where to put "FASTLANE_SESSION" value?

I'm using fastlane with Fastfile and Appfile
According this doc, i did create FASTLANE_SESSION variable in order to not enter a two-factor verification password every buildtime. But can't figure out where and how to put it to make it work. I don't use CI service, only fastlane in command line to deploy my ios build. Help please.
Run and follow the instructions: fastlane spaceauth -u some#email.com
When asked to copy the session, you can just say no. Fastlane will store it on your Mac.
You should really consider creating an API Key. Then you will avoid this.
Docs: https://docs.fastlane.tools/app-store-connect-api/#creating-an-app-store-connect-api-key
You need FASTLANE_SESSION available as an environment variable. If you're only running on command line you can do export FASTLANE_SESSION='<your-session>' and the next time you run the lanes that require the session should work.

Postgresql : SSL certificate error unable to get local issuer certificate

In PostgreSQL, whenever I execute an API URL with secure connection with query
like below
select *
from http_get('https://url......');
I get an error
SSL certificate problem: unable to get local issuer certificate
For this I have already placed a SSL folder in my azure database installation file at following path
C:\Program Files\PostgreSQL\9.6\ssl\certs
What should I do to get rid of this? Is there any SSL extension available, or do I require configuration changes or any other effort?
Please let me know the possible solutions for it.
A few questions...
First, are you using this contrib module: https://github.com/pramsey/pgsql-http ?
Is the server that serves https://url....... using a self-signed (or invalid) certificate?
If the answer to those two questions is "yes" then you may not be able to use that contrib module without some modification. I'm not sure how limited your access is to PostgreSQL in Azure, but if you can install your own C-based contrib modules there is some hope...
pgsql-http only exposes certain CURLOPTs (see: https://github.com/pramsey/pgsql-http#curl-options) values which are settable with http_set_curlopt()
For endpoints using self-signed certificates, I expect the CURLOPT you'll want to include support for to ignore SSL errors is CURLOPT_SSL_VERIFYPEER
If there are other issues like SSL/TLS protocol or cipher mismatches, there are other CURLOPTs that can be patched-in, but those also are not available without customization of the contrib module.
I don't think anything in your
C:\Program Files\PostgreSQL\9.6\ssl\certs
folder has any effect on the http_get() functionality.
If you don't want to get your hands dirty compiling and installing custom contrib modules, you can create an issue on the github page of the maintainer and see if it gets picked up.
You might also take a peek at https://github.com/pramsey/pgsql-http#why-this-is-a-bad-idea because the author of the module makes several very good points to consider.

installing kubernetes on coreos with rkt and automated script

I'm trying to install kuberentes with rkt on my real (not virtual) coreos servers at home using the scripts at https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic and I have some questions.
my etcd2 is using tls keys, I can't see anywhere in the script where I can define where the certificates are located.
can I supply a domain instead of IP for ADVERTISE_IP and CONTROLLER_ENDPOINT ?
when I tried to install kubernetes manually I needed start the rkt service api. it doesn't state in the documents that it needed here, does it mean that I don't need it if I use these scripts? or is it just something that's missing in the documents?
thanks!
update
Rob thank you so much for your response. I wasn't clear enough regarding etcd2. I already have etcd2 tls installed and properly configured on my coreos servers. so I configured my etcd servers in the controller-install.sh file:
export ETCD_ENDPOINTS="https://coreos-2.tux-in.com:2379,https://coreos-3.tux-in.com:2379"
but when I run the controller-install.sh script, it returns and repeat the following output:
Waiting for etcd...
Trying: https://coreos-2.tux-in.com:2379
Trying: https://coreos-3.tux-in.com:2379
Trying: https://coreos-2.tux-in.com:2379
Trying: https://coreos-3.tux-in.com:2379
...
so I was guessing it's because i didn't define etcd related tls certificates in the controller script and that is why it stuck in that faze.
on my macbook pro laptop I have the following alias configured:
alias myetcdctl="~/apps/etcd-v3.0.8-darwin-amd64/etcdctl --endpoint=https://coreos-2.tux-in.com:2379 --ca-file=/Users/ufk/Projects/coreos/tux-in/etcd/certs/certs-names/ca.pem --cert-file=/Users/ufk/Projects/coreos/tux-in/etcd/certs/certs-names/etcd1.pem --key-file=/Users/ufk/Projects/coreos/tux-in/etcd/certs/certs-names/etcd1-key.pem --timeout=10s"
so when I run myetcdctl member list I get:
8832ce6a269a7dac: name=ccff826d5f564c67abf35467306f80a0 peerURLs=https://coreos-3.tux-in.com:2380 clientURLs=https://coreos-3.tux-in.com:2379 isLeader=true
a2c0ac9708ef90fc: name=dc38bc8f20e64940b260d3f7b260430d peerURLs=https://coreos-2.tux-in.com:2380 clientURLs=https://coreos-2.tux-in.com:2379 isLeader=false
so I'm guessing that I don't really have a problem there.
any ideas?
thanks!
my etcd2 is using tls keys, I can't see anywhere in the script where I can define where the certificates are located.
These scripts don't start an etcd server. You will need to set one up manually and will be able to use TLS and as many nodes as you would like. This isn't clear in the current form of the document, I will attempt a PR to fix.
can I supply a domain instead of IP for ADVERTISE_IP and CONTROLLER_ENDPOINT ?
Only CONTROLLER_ENDPOINT be a domain name.
when I tried to install kubernetes manually I needed start the rkt service api. it doesn't state in the documents that it needed here, does it mean that I don't need it if I use these scripts? or is it just something that's missing in the documents?
These scripts include/start the rkt API service. As you can see below, it also has a Restart parameter set (source):
[Unit]
Before=kubelet.service
[Service]
ExecStart=/usr/bin/rkt api-service
Restart=always
RestartSec=10
[Install]
RequiredBy=kubelet.service

Is it possible to ignore Ember CLI's http-mocks proxy server?

I've created some ember g http-mocks, and they live in my ember app under /server.
I'd also like to be able to run my ember cli app, proxying all api requests to localhost:3000.
It seems if /server exists, ember will use it, regardless of the -proxy flag. I found some discussion about a --no-http-mocks flag near the end of this issue, but I don't think there's a formal proposal yet.
Is there any hackish intermediate way to get ember cli to ignore /server, other than by deleting the entire /server directory?
You could probably set up ember-cli to enable/disable http-mock based on an environments.js variable as described here:
http://discuss.emberjs.com/t/how-to-disable-http-mock-server-within-environment-config-file/6660
Then to manually flip http-mock on and off as you like, pass in a process environment variable when you run your ember serve at command line. Seems like the way to do that is in this SO post:
How to pass API keys in environment variables to Ember CLI using process.env?

HttpRequestTask and https

Is it possible to perform request to https using http-request phing task?
If no - what workaround could you propose? wget?
Yes, you are not limited to HTTP only - HTTPS works fine.
Examples are shown in the phing documentation:
<http-request url="https://accounts.google.com/"/>
Alternatively, you can use the curl adapter:
<http-request url="https://accounts.google.com/" verbose="true">
<config name="adapter" value="HTTP_Request2_Adapter_Curl"/>
</http-request>
It seems that by default you won't be able to connect using https. This is because the Phing http task uses the PEAR HTTP_Request2 libraries to make the connection. That in turn uses either PHP curl or sockets to make the connection. When connecting to https it needs to verify the CA certificate. That can be switched off so any certificate is supported but the Phing task doesn't support passing the option over to HTTP_Request2.
So if you otherwise like the Phing http task I suggest you either copy and modify the task or write your own that extends the original one so it supports the ssl_verify_peer option.
Or you can always default to the exec task and fetch whatever you need using curl of wget which however might not work on multiple platforms.
Here are links where you find more info:
PEAR HTTP_Request2 configuration options
Source code of the Phing http task
HTTP_Request2 info about https and proxy servers (Search for https)
How to write your own Phing task