Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add management commands #194

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

skatsaounis
Copy link

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
Copy link
Author

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?

@furlongm
Copy link
Owner

furlongm commented Sep 22, 2020

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?

@skatsaounis
Copy link
Author

@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
Copy link
Author

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

@furlongm furlongm force-pushed the develop branch 3 times, most recently from 9009f46 to 76e3492 Compare February 23, 2021 04:19
@furlongm furlongm force-pushed the develop branch 6 times, most recently from d3be836 to 2fab942 Compare March 11, 2021 03:36
@furlongm furlongm force-pushed the develop branch 4 times, most recently from 4d964df to 22f1d99 Compare March 13, 2021 21:48
@furlongm furlongm force-pushed the develop branch 10 times, most recently from 5ed6ccc to 2ae3a23 Compare October 3, 2021 22:16
@furlongm
Copy link
Owner

@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?

@skatsaounis skatsaounis changed the base branch from develop to master October 31, 2021 20:04
@skatsaounis
Copy link
Author

@furlongm feel free to take a look again

@furlongm furlongm reopened this Jun 21, 2024
f.close()

fh = codecs.open(temp, 'w+b', encoding='utf-8')
fh.write(settings_contents)

Check failure

Code scanning / CodeQL

Clear-text storage of sensitive information High

This expression stores
sensitive data (secret)
as clear text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants