software-discovery-tool icon indicating copy to clipboard operation
software-discovery-tool copied to clipboard

Installation doc improvements for Ubuntu 20.04/22.04

Open pleia2 opened this issue 4 years ago • 9 comments

During pip install of several modules, 'cffi==1.11.5' and 'cryptography==1.4' were specifically defined, but they failed to install properly. Instead, I dropped the version specifications and the tool seems to be working as expected.

Under step 5, you need to use sudo for both commands:

sudo git submodule init && sudo git submodule update

pleia2 avatar Feb 11 '22 20:02 pleia2

sudo git submodule init && sudo git submodule update

We're trying to avoid this, by giving ownership to apache user, sudo is not necessary. This reduces the chances of privilege escalation through apache user since he's not in sudoers file

rachejazz avatar Feb 11 '22 21:02 rachejazz

Yeah, perhaps what needs to be done is added instructions to "sudo su - apache" and then run those commands as the apache user?

pleia2 avatar Feb 11 '22 23:02 pleia2

Yes documentation needs a brush up. Perhaps this can be in the todo list? The gist I've written needs some changes as well due to the recent new activities. Someone can help track those? I got busy with my job lately, apologies.

rachejazz avatar Feb 12 '22 12:02 rachejazz

I had recently tried installing and setting up Software Discovery Tool on Ubuntu 20.04(based on the instructions provided) and even I had faced some trouble. Some of the issues I encountered were :

  • Issue with installing cffi (v 1.11.5) and cryptography(v 1.4) as stated above by @pleia2 Solution : Simply installing cffi and cryptography was enough for me to proceed with the installation steps.
  • Issue following the instructions (provided here) for Ubuntu 20.04 Solution : Instead of copying the .conf files in sites-enabled directory , the instruction should be to copy them to sites-available directory as copying the sites to the former directory leads to an error showing that the site is not available.

I would love to work on this issue for improving the docs for the installation steps for Ubuntu 20.04 Thanks!

arshPratap avatar Mar 19 '22 03:03 arshPratap

Good catch! Assigning this to you. Also, consider joining our slack channel (on openmainframeproject workspace) if you want to discuss anything.

rachejazz avatar Mar 19 '22 11:03 rachejazz

Hey @pleia2 , @rachejazz I just made a PR(#85) on this issue.Looking forward to your suggestions

arshPratap avatar Mar 24 '22 21:03 arshPratap

Thank you @arshPratap. This was on my list so this was the nudge I needed to look at it :smile:

The last outstanding part of this is how we handle the submodules command, but that's going to be a longer discussion around the ownership of the files in general from a best practices perspective. Still, I'll leave this open until we resolve that as well.

pleia2 avatar Mar 24 '22 21:03 pleia2

@pleia2 I totally understand.Handling git submodules could really be a tough job (saying this from personal experience)

arshPratap avatar Mar 25 '22 19:03 arshPratap

In this section: https://github.com/openmainframeproject/software-discovery-tool/blob/master/docs/Installation.md#updating-data-directory

The commands should be run by the apache user with sudo, so:

sudo -u apache git pull <upstream remote> <default branch> --recurse-submodules

sudo -u apache git submodule update --recursive --remote

Also, let's include some common gotchas for installation. This is a big one we're running into a lot: when source files in distro_data/data_files/ don't matching up with what's in src/config/supported_distros.py the cached data file isn't created and the tool fails to work.

pleia2 avatar Jun 22 '23 14:06 pleia2