Compare commits
2 Commits
1463667306
...
471395fba7
Author | SHA1 | Date | |
---|---|---|---|
471395fba7 | |||
ae3688b166 |
8
.env
8
.env
@ -1,8 +0,0 @@
|
||||
NETWORKNAME=
|
||||
MYSQL_ROOT_PASSWORD=
|
||||
MYSQL_USER=
|
||||
MYSQL_PASSWORD=
|
||||
MYSQL_DATABASE=
|
||||
MYSQL_USER=
|
||||
MYSQL_PASSWORD=
|
||||
MYSQL_DATABASE=
|
50
bin/generate_env.sh
Normal file
50
bin/generate_env.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
ENV_FILE=".env"
|
||||
|
||||
# Function to generate a random alphanumeric password of a given length
|
||||
generate_password() {
|
||||
tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c "${1:-12}"
|
||||
}
|
||||
|
||||
# Function to prompt for a value if not set as a parameter
|
||||
prompt_for_value() {
|
||||
read -p "$1: " value
|
||||
echo "$value"
|
||||
}
|
||||
|
||||
# Set $PROJECTNAME if not provided as a parameter
|
||||
PROJECTNAME=${1:-$(prompt_for_value "Enter PROJECTNAME")}
|
||||
|
||||
cat <<EOF > $ENV_FILE
|
||||
# Docker
|
||||
NETWORKNAME=admin_web
|
||||
|
||||
# MySQL
|
||||
MYSQL_ROOT_PASSWORD=$(generate_password)
|
||||
MYSQL_USER=u_$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]')
|
||||
MYSQL_PASSWORD=$(generate_password)
|
||||
MYSQL_DATABASE=db_$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# GITEA
|
||||
GITEA_API_URL=REPLACEME
|
||||
ACCESS_TOKEN=REPLACEME
|
||||
|
||||
# Joomla
|
||||
EMAIL=noreply@$(echo $PROJECTNAME | tr '[:upper:]' '[:lower:]').com
|
||||
JOOMLA_USER="$PROJECTNAME"
|
||||
JOOMLA_USERNAME=admin
|
||||
# Passwords must be 12 characters long (admin-password)
|
||||
JOOMLA_PASSWORD=$(generate_password)
|
||||
|
||||
# SMTP
|
||||
SMTP_USER=null
|
||||
SMTP_PASS=null
|
||||
SMTP_HOST='mailhog'
|
||||
SMTP_SECURITY='None'
|
||||
SMTP_PORT=1025
|
||||
EOF
|
||||
|
||||
rm $0
|
||||
|
||||
echo "Generated $ENV_FILE with randomly generated passwords and customized PROJECTNAME."
|
@ -1,14 +1,15 @@
|
||||
#!/bin/bash
|
||||
# This Bash script initializes a new Git repository, removes existing Git info, creates a README.md with the project name, and makes an initial commit.
|
||||
|
||||
PROJECTNAME=$(basename "$(pwd)")
|
||||
|
||||
# Remove existing Git repository information
|
||||
rm -rf .git
|
||||
rm -rf .git # Remove existing Git repository information
|
||||
|
||||
rm README.md
|
||||
# New readme for Project
|
||||
rm README.md
|
||||
touch README.md
|
||||
echo "# ${PROJECTNAME}" > README.md
|
||||
echo "" > README.md
|
||||
echo "" >> README.md
|
||||
echo "Created a fresh repo for your ${PROJECTNAME} project." >> README.md
|
||||
|
||||
# Initialize a new Git repository
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Creates a private Git repository on Gitea using its API, adds a remote origin to the local Git repository, and pushes existing changes to the master branch.
|
||||
|
||||
PROJECTNAME=$(basename "$(pwd)")
|
||||
|
||||
|
Reference in New Issue
Block a user