patchman icon indicating copy to clipboard operation
patchman copied to clipboard

Add management commands

Open skatsaounis opened this issue 6 years ago • 6 comments

This MR adds the following management commands:

  • createsuperuser_with_password: Gives the option to create superuser with password from the CLI
  • set_secret_key: sets the SECRET_KEY. It copies the existing functionality of patchman-manage
  • set_rdns_check: It sets rDNS check for hosts

skatsaounis avatar Apr 10 '20 10:04 skatsaounis

Hi @furlongm, I am revisiting this PR since you appear to be active in Patchman again. Should I rebase to current develop and work on merging this PR? Do you find it a good idea?

skatsaounis avatar Sep 22 '20 16:09 skatsaounis

A rebase on develop would make it clearer what's in the PR.

For the commands, I'm not sure if they are better as part of the patchman cli or in a set of separate commands? I think the rdns option is already set there?

For setting the secret key, it's useful to be able to do that without the app being fully functional (like when installing from deb or rpm).

The createsuper command might also be useful there though.

So not sure where they should go really, or what is best practice in this case?

furlongm avatar Sep 22 '20 17:09 furlongm

@furlongm I proceeded with the rebase.

The main reason behind these commands, is the Helm Chart I have already developed. Inside that Helm Chart, there are some Jobs which are using the Patchman Docker image to prepare Patchman deployment. For example, setting the secret key, applying migrations, creating superuser with password (this is needed as long as Patchman stays in Django < 3.0. They added it to Django > 3.0 https://docs.djangoproject.com/en/3.0/ref/django-admin/#createsuperuser)

skatsaounis avatar Sep 23 '20 13:09 skatsaounis

@furlongm Hi Marcus. Did you have the chance to take a look here? This acts as a kind reminder.

skatsaounis avatar Nov 23 '20 06:11 skatsaounis

@skatsaounis apologies for the delay in replying! I released v2 with a lot of the django updates in it. Could you rebase this PR onto master?

furlongm avatar Oct 26 '21 15:10 furlongm

@furlongm feel free to take a look again

skatsaounis avatar Oct 31 '21 20:10 skatsaounis