Skip to content

Commit

Permalink
MP:
Browse files Browse the repository at this point in the history
  • Loading branch information
clecap committed Dec 19, 2024
1 parent 6a19775 commit 2bbe528
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
5 changes: 3 additions & 2 deletions images/dante-wiki/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ RUN \
a2enmod authnz_ldap && \
# GNU parallel helps with fast copying
apt-get install -y --no-install-recommends parallel && \
# ssh client, needed for doing backups
apt-get install -y --no-install-recommends openssh-client && \
# ssh client and rsync needed for doing backups
apt-get install -y --no-install-recommends openssh-client rsync && \
## Install pymupdf
#
# 1) Installations with pip should use a virtual python environment or a --break-system-package (which is not recommended)
Expand All @@ -269,6 +269,7 @@ RUN \
# need wheel package for installing aws command line
/opt/myenv/bin/pip3 install --no-cache-dir wheel && \
/opt/myenv/bin/pip3 install awscli --use-pep517 && \
################################################################################################################# /opt/myenv/bin/pip3 install pygments && \
exit && \
echo "*** *** *** Final cleanup " && \
apt-get purge -y php-dev build-base linux-headers && \
Expand Down
3 changes: 3 additions & 0 deletions images/dante-wiki/src/etc/backup/backup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ MODE="$1"
TRANS="$2"
FREQ="$3"


export PREFIX="wiki-dir"

source /run/secrets/configuration

export MYSQL_PWD="${MYSQL_ROOT_PASSWORD}"
Expand Down
7 changes: 5 additions & 2 deletions images/dante-wiki/src/etc/cron.daily/backup-start-daily.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
# TRANS Parameter 2: How to transport to the backup place. Values: rsync or ssh_stream (or aws_stream, github_stream and more)
# FREQ Parameter 3: Identifies time stamp and kind of the dump. Eg: week-10 day-2024-07-28 or similar

/etc/backup/backup-script.sh sql rsync day "day_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh xml ssh_stream day "day_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh sql rsync "day_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh xml ssh_stream "day_$(date +'%Y-%m-%d_%H-%M-%S')"

/etc/backup/backup-script.sh sql aws-s3 "day_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh xml aws-s3 "day_$(date +'%Y-%m-%d_%H-%M-%S')"
16 changes: 16 additions & 0 deletions images/dante-wiki/src/etc/cron.weekly/backup-start-weekly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# activate /etc/backup/backup-script.sh

##
## PARAMETERS supplied to the script:
##
# MODE Parameter 1: Which backup to generate. Values: sql or xml
# TRANS Parameter 2: How to transport to the backup place. Values: rsync or ssh_stream (or aws_stream, github_stream and more)
# FREQ Parameter 3: Identifies time stamp and kind of the dump. Eg: week-10 day-2024-07-28 or similar

/etc/backup/backup-script.sh sql rsync "week_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh xml ssh_stream "week_$(date +'%Y-%m-%d_%H-%M-%S')"

/etc/backup/backup-script.sh sql aws-s3 "week_$(date +'%Y-%m-%d_%H-%M-%S')"
/etc/backup/backup-script.sh xml aws-s3 "week_$(date +'%Y-%m-%d_%H-%M-%S')"
14 changes: 0 additions & 14 deletions images/dante-wiki/src/etc/logrotate.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Generates a (public, private) key pair for use in localhost
# Mails the public key to SMTP_TO
# Installs the public and private key
#
# Installs the fingerprint of the ssh host locally

source /home/dante/dantescript/common-defs.sh

Expand Down Expand Up @@ -82,7 +84,8 @@ else
fi



sudo ssh-keyscan ${SSH_HOST} >> /tmp/known_hosts
sudo mv /tmp/known_hosts /root/.ssh/known_hosts

exec 1>&1 2>&2

Expand Down
10 changes: 10 additions & 0 deletions images/dante-wiki/src/usr/local/bin/pygmentize
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# provides a trampoline mechanism for activating the virtual python environment
# where pygmentize is installed and then invoking the connected pygmentize
# need this since pygmentize wants ot be installed in virtual python and
# latex looks for it in /usr/local/bin, but without invoking the virtual environment first

source /opt/myenv/bin/activate

/opt/myenv/bin/pygmentize $@

0 comments on commit 2bbe528

Please sign in to comment.