Develop on OSX - missing steps (ca-certificate)

Hi there,
I would say that I am an advanced beginner with ruby / rails dev, but I am mission some steps during set up a development environment ion OSX (10.14 in my case).
I went through the wiki pages and adapted the config/diaspora.yml. But on the certificate_authorities step I struggle:
What to fill in on OSX? What is a bundle? Can I export some CA from keychain?

The setup - documentation for OSX is somewhat missing in some steps. I do not plan to start a pod, I just like to start on my dev-machine.

There’s a stackoverflow about this issue I found after a quick search.

As far as I’m aware, you shouldn’t need to do anything with certificate authorities for a development environment. CAs should only be needed for secure communication between nodes, which for most development work isn’t necessary – unless the development you’re doing involves federation.

I take it you’ve followed the installation instructions for Mac OS 10.13. If you haven’t followed that step-by-step, it’s likely you’ve done something wrong at some point.

Note that there is a not very obvious link after Bundler installation to Notes On Installing and Running Diaspora. You need to follow the instructions on that page to complete the installation, but to take note of the exceptions for Mac OS listed below that link on the Mac OS 10.13 installation page.

Bunder is a gem manager for Ruby. Once installed with sudo gem install bundler, you install (and later update) the gems you need to run diaspora* with bin/bundle install --full-index.

I’m not a dev, so I’d better leave it there for people more competent than I to help. But I hope it helps you find the missing steps from what you have so far done.

If you’ve noted any differences there are between the installation instructions for OS 10.13 and what you had to do to install on 10.14, you could usefully help to create an installation guide for 10.14.

1 Like

In config/diaspora.yml you need to setup a path to a certification bundle. On OSX there is no auch file.
But to launch
RAILS_ENV=production bundle exec rake db:create db:migrate
diaspora need a path to a ca bundle file. A “FATAL: Diaspora doesn’t know where your certificate authorities are. Please ensure they are set to a valid path in diaspora.yml” error appears.

To solve the problem you will need to install a ca-bundle file.
With rvm installed you can setup these steps:

  1. install ‘certified’ gem: gem install certified
  2. update certs: certified-update
  3. find the cert bundle path. In my case: /Users/thorstenclaus/.rvm/gems/ruby-2.4.4/gems/certified-1.0.0/certs/ca-bundle.crt
  4. copy the full path to the ‘certificate_authorities’ in config/diaspora.yml file
  5. run RAILS_ENV=production bundle exec rake db:create db:migrate to setup database.

Now we can start the server and continue with

Can someone confirm this? Should this be added to the OSX setup documentation?

You’ve stated that you want to set up a development environment. But RAILS_ENV=production is for a production environment (a working pod). You need to visit the Versions of this guide section of the Notes on installation page and choose the Development option under ‘Running mode’ and choose which database software you are using. You’ll then get the correct instructions for that environment (which shouldn’t include any CAs).

By the way, there is now a Docker image available for setting up a dev environment, which should make installation a lot easier. See this PR. This is now included in the core code base.

1 Like

Thanks you are right. I just follwed the macOS instructions, went back to ‘Notes on installing Diaspora’ as advised and touched down on the ‘production’ page.
With bundle exec rake db:create db:migrate I was now able to setup diaspora on macOS 10.14 and get the welcome-page. :grinning:

What is really needed is a clearer setup guide for macOS.
Thanks all for advise

Glad I could help.

The guides can definitely be improved, and work to do that should hopefully be coming soon.

I’ve set this up on Linux many times and will be setting this up on Mac for the first time this week. I can provide a side-by-side and maybe tweak things as necessary. One thing that jumps out at me immediately is that unlike the Linux guide (or the Ubuntu guide anyway), there aren’t options for choosing Database type, dev vs. production, etc. So there could be some work to do there.

There are: see my comment above about how to find and set them.

There are and there aren’t. There are when you go to the “Follow this other guide” part. There is not in the macOS one. For example, I’m not interested in deploying MySQL yet the macOS guide only specifies that. Etc.

I just finished setting up development under macOS for the first time. I got everything working except jasmine:ci. I’m not sure if that’s because I need to have Chrome/Chromium installed or what. Having done dev setups several times I do notice some areas of improvements needed. I’m capturing them here to fix later (or if someone else is doing that they can be on the lookout for them):

  1. Need to have the database selection again. I was able to install Postgres via following another guide for installing it through brew. I have zero intention of install MySQL if I can avoid it ;).
  2. It links to the “installation/backport” guide but that guide doesn’t discuss setting up the Ruby system or the database. Went to the Ubuntu guide for the steps for setting up RVM and the database.
  3. I didn’t need to de the arch x86_64 step at all. I think this may be an obsolete step.

I think we can redo this guide based on the same reference as the other install guides with the OS specific stuff grafted into the appropriate place. It will make it more consistent and easier to follow, I think.

In reply for the database part:
There is a postgresApp for macOS. PostgresApp.com which installs the Postgres database super easy on a Mac without the need for brew.
Maybe this can be added to the setup doc for new developers.

If you are thinking about spending time on the current macOS guides: please do not. The guides in the wiki are currently deprecated, and as macOS is a platform supported for development only, we will only support Docker-based setups in the future for mac, which will make the guide simpler, less prone to error, and everyone will be more happy. However, that guide is not done yet (I am working on it, so standby).

The guides in the wiki are deprecated? What are they being replaced with? I’m focusing on it, and the guides in general, from the developer platform perspective.

… :wink: There will be guides on how to use Docker for diaspora development.

I’m not sure how I feel about that, but my initial reaction is to be uneasy about it. I do my work in RubyMine on a VM or bare metal. A lot of the setup steps are needed to make that happen. I can see skinnying the guides down to make it developer-centric but I can’t imagine not needing a developer install guide at all.

…or is this referring just to the Mac not all install guides?

I am sure that macOS will be a Good Platform for developing. (Not for production environments)

1 Like

Fear not, @HankG! Dennis doesn’t mean that you’ve followed a broken guide. The ones in the wiki are still the ones to follow today, but Dennis is working on an improved set up installation guides. What he means, I think, is: please don’t spend any time trying to improve the guides in the wiki, because that will very soon be superseded by the new guides he’s working on, so it would be wasted energy.

Thanks @goob, I got it working so not worried about that. I may have over-interpreted what he was saying that we wouldn’t have guides except for using Docker setups. Overhauling the guides sounds good. I’d be happy to help test them as well from a developer-centric perspective. Eliminating all guides except the Docker guide would be concerning to me.

On my post from earlier this morning, I wasn’t planning on making any changes to the macOS guide in the short term anyway but didn’t want to lose the hiccups I found either.

@HankG, see this comment from Dennis, which is what you reacted to:

In that contexts, it looks as though only Mac is going Docker-only. Probably because none of the core developers works primarily in Mac OS.