7 Commits
Author SHA1 Message Date
r.didato b515760e6d Fix config 2022-10-04 19:47:16 +02:00
r.didato ea4e0c0ec3 FromName email 2022-10-02 19:54:26 +02:00
r.didato 3f04905d22 #12 Backup + fix config email 2022-10-02 19:45:09 +02:00
r.didato 0ab6391bf3 #12 2022-10-02 19:16:59 +02:00
r.didato a66dfa8530 CICD 2022-10-02 15:58:36 +02:00
r.didato 09cf83c31b Typo 2022-10-01 20:03:35 +02:00
r.didato aac8e9786d CICD minor 2022-10-01 12:47:32 +02:00
9 changed files with 79 additions and 13 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ $currentSystem->apache->user = "var-www";
$currentSystem->apache->group = "var-www"; $currentSystem->apache->group = "var-www";
$currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html $currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html
$currentSystem->remoteLocationPath = getenv('ASD_PUBLIC_URL')."/"; $currentSystem->remoteLocationPath = getenv('DDNINJA_PUBLIC_URL')."/";
// Deprecato in quanto CBS2 è stato dismesso // Deprecato in quanto CBS2 è stato dismesso
$backupSystem = new stdClass(); $backupSystem = new stdClass();
@@ -134,7 +134,7 @@ $config->database = $database;
$config->mailer = new stdClass(); $config->mailer = new stdClass();
$config->mailer->address = "email-smtp.eu-west-1.amazonaws.com"; $config->mailer->address = "email-smtp.eu-west-1.amazonaws.com";
$config->mailer->port = "25"; $config->mailer->port = "587";
$config->mailer->username = "AKIASMB7IW2MQPUP5CXS"; $config->mailer->username = "AKIASMB7IW2MQPUP5CXS";
$config->mailer->password = "BHv+82Nns1kIKg99Hx0sjKlEpR+X4+1EgX+ec64n/mBt"; $config->mailer->password = "BHv+82Nns1kIKg99Hx0sjKlEpR+X4+1EgX+ec64n/mBt";
$config->mailer->smtpAuth = true; $config->mailer->smtpAuth = true;
+1 -3
View File
@@ -49,9 +49,7 @@ class MailModel extends Model implements FDN_MailInterface{
$email->isMail(); $email->isMail();
$email->From = $this->from; $email->From = $this->from;
if ($this->hasProperty("fromName")){ $email->FromName = "I Fatti di Napoli";
$email->FromName = $this->fromName;
}
$email->Subject = $this->subject; $email->Subject = $this->subject;
+13
View File
@@ -0,0 +1,13 @@
FROM alpine:3.6
RUN apk add --no-cache --upgrade bash mongodb-tools
# copy crontabs for root user
COPY crontab /etc/crontabs/root
# copy backup script
COPY backup /myscripts/backup
RUN chmod 0744 /myscripts/backup
# start crond with log level 8 in foreground, output to stderr
CMD ["crond", "-f", "-d", "8"]
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
DATE=`date +"%Y-%m-%d_%H:%M"`
echo "Generating backup $DATE"
DATABASE_HOST="fdn2.production.database"
DATABASE_NAME="fdn2"
DATABASE_PORT="27017"
WORKDIR="/workdir"
STORAGE="/backups"
mkdir -p $WORKDIR
mongodump --host $DATABASE_HOST -d $DATABASE_NAME --port $DATABASE_PORT --out "$WORKDIR"
tar -cvzf "$STORAGE/dump-$DATE.tar.gz" "$WORKDIR"
for old in `ls -t $STORAGE | tail -n +7`; do
TOREMOVE="$STORAGE/$old"
echo "Removing '$TOREMOVE'";
rm -r $TOREMOVE
done
+1
View File
@@ -0,0 +1 @@
4 0 * * * /myscripts/backup 2>&1
+17
View File
@@ -0,0 +1,17 @@
version: "3"
services:
backup:
image: cronjob
build: ./
networks:
- backup-network
restart: "unless-stopped"
volumes:
- /home/ddninja/fdn2/backups:/backups
networks:
backup-network:
external: true
name:
backup-network
+11 -2
View File
@@ -5,8 +5,11 @@ services:
restart: "on-failure:5" restart: "on-failure:5"
networks: networks:
db-network: db-network:
backup-network:
aliases:
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database
volumes: volumes:
- ./persistence/database/mongodb:/usr/local/mongodb - ./persistence/database/mongodb:/data/db/
logging: logging:
driver: "json-file" driver: "json-file"
options: options:
@@ -63,7 +66,7 @@ services:
max-size: "150m" max-size: "150m"
memcached: memcached:
image: memcached:1.6.9-alpine image: memcached:1.6.9-alpine
restart: "on-failure:3" restart: "on-failure:5"
networks: networks:
§PROJECT_BUILDNAME§-network: §PROJECT_BUILDNAME§-network:
logging: logging:
@@ -75,6 +78,10 @@ services:
networks: networks:
db-network: db-network:
§PROJECT_BUILDNAME§-network: §PROJECT_BUILDNAME§-network:
backup-network:
external: true
name:
backup-network
nginx-network: nginx-network:
external: true external: true
name: name:
@@ -83,5 +90,7 @@ networks:
volumes: volumes:
§PROJECT_BUILDNAME§-ws-log: §PROJECT_BUILDNAME§-ws-log:
§PROJECT_BUILDNAME§-wk-log:
§PROJECT_BUILDNAME§-db-persist: §PROJECT_BUILDNAME§-db-persist:
§PROJECT_BUILDNAME§-job-comms: §PROJECT_BUILDNAME§-job-comms:
+7 -3
View File
@@ -5,10 +5,11 @@ services:
restart: "no" restart: "no"
networks: networks:
db-network: db-network:
backup-network:
aliases: aliases:
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database - §PROJECT_BUILDNAME§.local.database
volumes: volumes:
- §PROJECT_BUILDNAME§-db-persist:/usr/local/mongodb - §PROJECT_BUILDNAME§-db-persist:/data/db/
webserver: webserver:
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-webserver-debug image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-webserver-debug
env_file: env_file:
@@ -53,11 +54,14 @@ services:
networks: networks:
db-network: db-network:
§PROJECT_BUILDNAME§-network: §PROJECT_BUILDNAME§-network:
backup-network:
external: true
name:
backup-network
volumes: volumes:
§PROJECT_BUILDNAME§-storage: §PROJECT_BUILDNAME§-storage:
§PROJECT_BUILDNAME§-log: §PROJECT_BUILDNAME§-log:
# edenlandia-worker-log:
§PROJECT_BUILDNAME§-db-persist: §PROJECT_BUILDNAME§-db-persist:
§PROJECT_BUILDNAME§-job-comms: §PROJECT_BUILDNAME§-job-comms:
+1 -1
View File
@@ -157,7 +157,7 @@ if [[ $PUBLISH_MODE -eq 1 ]]; then
# WORKER # WORKER
msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker" msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker"
./build.sh -I webserver -$BUILDOPT -t "$TAG-worker" ./build.sh -I worker -$BUILDOPT -t "$TAG-worker"
./run-unit.sh $VERBOPT -t "$TAG-worker" ./run-unit.sh $VERBOPT -t "$TAG-worker"