refactor(structure): reorganize monorepo with projects, terraform hierarchy, and strict k8s namespace rules

This commit is contained in:
Moritz Graf
2026-10-12 13:49:41 +02:00
parent 4831147087
commit 8f01b75bd6
4766 changed files with 551 additions and 91 deletions
+39
View File
@@ -0,0 +1,39 @@
# /// script
# dependencies = [
# "bcrypt",
# ]
# ///
import bcrypt
import sys
def generate_htpasswd(username, password):
# Generate a salt
salt = bcrypt.gensalt()
# Hash the password with the generated salt
hashed_password = bcrypt.hashpw(password.encode('utf-8'), salt)
# Format the string for the .htpasswd
htpasswd_string = f"{username}:{hashed_password.decode('utf-8')}"
return htpasswd_string
def main():
# Check if the correct number of arguments are provided
if len(sys.argv) != 3:
print("Usage: python script.py <username> <password>")
sys.exit(1)
# Get the username and password from the command-line arguments
username = sys.argv[1]
password = sys.argv[2]
# Generate the htpasswd string
htpasswd_string = generate_htpasswd(username, password)
# Print the htpasswd string to stdout
print(htpasswd_string)
if __name__ == "__main__":
main()