From a5a780710d70e4d87518f6526cd3fb432c3cc1b3 Mon Sep 17 00:00:00 2001 From: magdev Date: Sat, 15 Apr 2023 10:22:00 +0200 Subject: [PATCH] Small fixes, typos, etc --- README.md | 2 +- init.rb | 2 +- scripts/crontab | 2 +- scripts/fetch-mails.sh | 16 ++++++++-------- scripts/git-post-receive.sh | 22 ---------------------- 5 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 scripts/git-post-receive.sh diff --git a/README.md b/README.md index f38f6ca..75cb98d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Common modifications to run Redmine as project management tool on medium- and la ```bash cd {redmine_dir}/plugins -git clone http://laptop.local:4000/magdev/baupm-core.git baupm_core +git clone https://hub.bundespruefstelle.ch/magdev/baupm_core.git baupm_core ``` Now restart redmine and you're done. diff --git a/init.rb b/init.rb index 9a259a4..edc404f 100644 --- a/init.rb +++ b/init.rb @@ -8,7 +8,7 @@ Redmine::Plugin.register :baupm_core do name 'BauPM Core Plugin' url 'https://git.bundespruefstelle.ch/magdev/baupm_core' author 'Marco Grätsch' - author_url 'https://github.com/magdev' + author_url 'https://git.bundespruefstelle.ch/magdev' description "Common modifications for BauPM" version '0.1.0' diff --git a/scripts/crontab b/scripts/crontab index 264f955..fb8b201 100644 --- a/scripts/crontab +++ b/scripts/crontab @@ -1,6 +1,6 @@ # Fetch emails -*/5 * * * * /home/bitnami/apps/redmine/fetch-mails >/dev/null 2>&1 +*/5 * * * * /opt/bitnami/redmine/fetch-mails >/dev/null 2>&1 # Update Letsencrypt Certificate #### Don't forget to set the --email and --domain arguments! #### diff --git a/scripts/fetch-mails.sh b/scripts/fetch-mails.sh index b5de37b..89f6db3 100644 --- a/scripts/fetch-mails.sh +++ b/scripts/fetch-mails.sh @@ -1,29 +1,29 @@ #!/bin/bash # Email-address of the system -mail_address="" +mail_address="${REDMINE_IMAP_ADDRESS}" # Email-Account username and password mail_username="$mail_address" -mail_password="" +mail_password="${REDMINE_IMAP_PASSWORD}" # IMAP-Server address and port -mail_host="" -mail_port=993 -mail_ssl=true +mail_host="${REDMINE_IMAP_HOST}" +mail_port=${REDMINE_IMAP_PORT:-993} +mail_ssl=${REDMINE_IMAP_SSL:-true} # IMAP-INBOX-Folder mail_folder="INBOX" # Default project and tracker -project="meta" -tracker="Support" +project="${REDMINE_IMAP_DEFAULT_PROJECT:-"meta"}" +tracker="${REDMINE_IMAP_DEFAULT_TRACKER:-"Support"}" # Redmine Settings unknown_user_action="ignore" allow_override="all" no_permission_check=true -app_root="/home/bitnami/apps/redmine/htdocs" +app_root="/opt/bitnami/redmine" if [[ -n "$mail_address" ]] && [[ -n "$mail_username" ]] && [[ -n "$mail_password" ]] && [[ -n "$mail_host" ]]; then sudo /opt/bitnami/ruby/bin/rake -f $app_root/Rakefile --silent redmine:email:receive_imap RAILS_ENV="production" \ diff --git a/scripts/git-post-receive.sh b/scripts/git-post-receive.sh deleted file mode 100644 index f7b7aca..0000000 --- a/scripts/git-post-receive.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -TARGET="/home/bitnami/apps/redmine/htdocs/public/themes/Ossig" -GIT_DIR="/repo/ossig-theme.git" -BRANCH="master" -RESTART_APACHE="" - -# shellcheck disable=SC2034 -# shellcheck disable=SC2162 -while read oldrev newrev ref; do - if [ "$ref" = "refs/heads/$BRANCH" ]; then - echo "Ref $ref received. Deploying ${BRANCH} branch to production..." - git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH - - if [[ -n $RESTART_APACHE ]]; then - echo "Restarting Apache Webserver" - sudo "$HOME/stack/ctlscript.sh" restart apache >>/dev/null 2>&1 - fi - else - echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server." - fi -done