Is it possible to decrypt files when using Xcode cloud? - continuous-integration

Using Github actions I'm able to run a script to decrypt files using gpg. This doesn't seem to work in Xcode cloud (I guess because gpg is not installed there).
Is there another way to encrypt and decrypt files when using Xcode cloud for CI? Or maybe there's a way to install gpg in Xcode cloud?
E.g. I want to be able to decrypt my JSON cloud config files.
After a lot of searching I can't seem to find any alternatives or even discussion about it. Is there a way to do it?
Or is this a silly thing to do in the first place? Maybe there's a better approach?

It turns out you can install gpg on Xcode cloud using homebrew.
I just added this line to my shell script before the decrypt lines and the build passed!
brew install gpg
See https://developer.apple.com/documentation/xcode/writing-custom-build-scripts for more info.

Related

gpg --import on Heroku

I am trying to run the following commands on Heroku to import and trust a PGP public key which I need to use to encrypt a file before sending it via SFTP:
heroku run gpg --import key.asc
heroku run gpg --edit-key email#example.com
The first command seems to work, but when I run the second command it fails to find the key. I get the following output when running heroku run gpg --list-keys:
gpg: directory '/app/.gnupg' created
gpg: keybox '/app/.gnupg/pubring.kbx' created
gpg: /app/.gnupg/trustdb.gpg: trustdb created
This may be due to the fact that Heroku does not allow writing to the file system, but I wanted to see if anyone knows what is going on and can help me figure out how to use this public key for encryption. It works locally using the iostreams gem to run something similar to the third example here
I guess that the problem is in the first command.The key.asc file in not in the dyno, it is on your computer. So, it is not importing anything.
You can run: heroku run bash and play directly inside the dyno.
Hope it helps!!!

Parse.com cloud code downloading binary

I'm using Parse.com and cloud code for some server side javascript functions on my website. I usually deploy updates to cloud code through parse deploy in the mac terminal.
Today when I have tried to do this it has come up with:
Downloading binary from https://parse.com/downloads/cloud_code/cli/parse-osx/latest.
I initially left this for about an hour and then cancelled it as it didn't seem to be going anywhere. I've then tried running parse deploy twice more but it is again just sitting there and seemingly not doing anything.
This has been working fine for the past 3 months.
Any suggestions?
EDIT:
Navigating to the posted link has let me download the file (it's 6.8MB), so I possibly just need to know how to install that?
Older command line tools may not be able to update themselves to v2. You will need to reinstall them (on OS X or Linux):
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
You can download the latest version for your platform from https://parse.com/docs/downloads
We posted about this a couple of weeks ago in the Parse Developer forums:
https://groups.google.com/forum/#!topic/parse-developers/WoRnDft4qmE
Reinstalling the command line tool seems to have fixed this issue.
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash

Installing dropbox (and use Kirby CMS) on openshift

I'm trying to find a way to integrate Kirby CMS with Dropbox running on Openshift using these tutorials:
http://getkirby.com/blog/kirby-meets-dropbox
http://getkirby.com/forum/how-to/topic:561
I already get stuck installing Dropbox, since I assume I don't really have permission while SSHing:
http://www.dropbox.com/install?os=lnx
So my question: Is there even any way of achieving all that greatness? If no, not even if we get reaaaally creative? If NO, why not? If yes, how?
Thanks a bunch!
I have no experience with Kirby, but here's how to get Dropbox working on Openshift.
The following is a combination of doing a Dropbox install on a server and doing it in a non-standard location. Everything gets done in $OPENSHIFT_DATA_DIR because that's where you have write privileges.
First, make sure you're in $OPENSHIFT_DATA_DIR
cd $OPENSHIFT_DATA_DIR
Next, download the appropriate version of Dropbox:
wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
This should give you the .dropbox-dist folder in $OPENSHIFT_DATA_DIR.
Next, tell Dropbox to start the installation process, but tell it that your home directory is actually the $OPENSHIFT_DATA_DIR:
HOME=$OPENSHIFT_DATA_DIR ./.dropbox-dist/dropboxd start -i
Follow the instructions to link your Dropbox account to the Openshift server. After it's linked, it should start syncing everything in your Dropbox account to $OPENSHIFT_DATA_DIR/Dropbox. This might be a bad thing for you because you have too much data in your Dropbox account. If so, then you should exclude folders.
You can do that with the CLI script that Dropbox provides. Still in $OPENSHIFT_DATA_DIR, download it:
wget -O dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
Make sure it's executable:
chmod +x dropbox.py
You need to run it the same way you would Dropbox:
HOME=$OPENSHIFT_DATA_DIR $OPENSHIFT_DATA_DIR/dropbox.py -h
Hope that helps.
You should be able to download/compile/install things into your OPENSHIFT_DATA_DIR (app-root/data) on your gear by using something like ./configure --prefix=~/app-root/data/dropbox, i tried that but i ran into missing the nautilus-whatever package, which i assume you could download and install in the same fashion, but i did not try past that point. As long as whatever you are running can be installed into the app-root/data, and does not require root permissions to run, you should be able to do it. If you get it going, you could also create a downloadable cartridge to run install it more easily.

Ruby/Github: Appropriate general solution for OpenSSL::SSL::SSLError?

Every now and then I'm encountering problems with scripts hosted on Github which have been linked using https. I've usually managed to get around it one way or the other, but I'm wondering what's the proper way of solving this?
Here's an example: I'd like to make use of this Rails Application template.
Running
rails new APP_NAME -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-devise-rspec-cucumber-template.rb -T
will throw:
certificate verify failed (OpenSSL::SSL::SSLError)
What is the proper way of going about this situation without editing the script itself?
UPDATE
I've tried so far as well
export GIT_SSL_NO_VERIFY=true
but I keep on getting the same error.
I also exported the certificate from Firefox as github.com.pem and simply dragged it into my unlocked Keychain Access. The certificate is now listed but the error remains the same.
UPDATE 2
As awful this solution is, this hack works: http://blog.dominicsayers.com/2011/08/16/howto-use-a-rails-template-from-github-on-windows/
It seems that simply "updating" the certificates is the best option:
$ cd /usr/share/curl/
$ sudo wget http://curl.haxx.se/ca/cacert.pem
$ sudo mv curl-ca-bundle.crt old.curl-ca-bundle.crt
$ sudo mv cacert.pem curl-ca-bundle.crt

Automated GIT clone

I would like to create either a script that can be executed or an application that will clone several GIT repositories for offsite data backup purposes.
I need this to be able to run on a Windows 7 machine (I'm sure this will add to the complexity of this problem).
I tried using GIT bash (MINGW shell) and using C# to create the shell and invoke commands to it. My tester was working fine until it attempted to supply the password. It appeared that the password prompt was coming from yet another terminal instance as stdin and stdout were not longer to read and write to the console.
Ideally I would like maintain a simple bash script that could be launched and clone the repositories but I was not able to find anything like that for Windows.
Any help or insight would be greatly appreciated.
The ssh keys should be created with no password. Ensure authorized keys file is updated on the machines you're connecting to.
Install msysgit and add the proper keys. I'm doing this without any issues. Make sure to set msysgit to not alter the line endings during it's install. You can change that later with git config if you forget. Use ssh and not putty.
Msysgit will give you bash on windows.
Hope this helps.

Resources