Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hedgedoc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible
roles
hedgedoc
Commits
0e756f37
Verified
Commit
0e756f37
authored
4 years ago
by
psy
Browse files
Options
Downloads
Patches
Plain Diff
move config to config file
parent
1b89eb2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/hedgedoc-retention-cron.cfg.j2
+6
-0
6 additions, 0 deletions
templates/hedgedoc-retention-cron.cfg.j2
templates/hedgedoc-retention-cron.sh.j2
+13
-7
13 additions, 7 deletions
templates/hedgedoc-retention-cron.sh.j2
with
19 additions
and
7 deletions
templates/hedgedoc-retention-cron.cfg.j2
0 → 100644
+
6
−
0
View file @
0e756f37
RETENTION_DAYS={{ hedgedoc.retention_cron.retention_days }}
MAIL_ENABLED={{ hedgedoc.retention_cron.mail.enabled|bool|lower }}
MAIL_TEMPLATE="{{ hedgedoc.retention_cron.mail.template }}"
BACKUP_ENABLED={{ hedgedoc.retention_cron.backup.enabled|bool|lower }}
BACKUP_PATH="{{ hedgedoc.retention_cron.backup.path }}"
BACKUP_KEEP_DAYS={{ hedgedoc.retention_cron.backup.keep_days }}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/hedgedoc-retention-cron.sh.j2
+
13
−
7
View file @
0e756f37
...
@@ -2,12 +2,18 @@
...
@@ -2,12 +2,18 @@
PATH
=
$PATH
:/usr/local/bin:/usr/sbin
PATH
=
$PATH
:/usr/local/bin:/usr/sbin
RETENTION_DAYS
={{
hedgedoc.retention_cron.retention_days
}}
# default values
MAIL_ENABLED
={{
hedgedoc.retention_cron.mail.enabled|bool|lower
}}
RETENTION_DAYS
=
30
MAIL_TEMPLATE
=
"{{ hedgedoc.retention_cron.mail.template }}"
MAIL_ENABLED
=
false
BACKUP_ENABLED
={{
hedgedoc.retention_cron.backup.enabled|bool|lower
}}
MAIL_TEMPLATE
=
/usr/local/etc/hedgedoc-util/mail.tpl
BACKUP_PATH
=
"{{ hedgedoc.retention_cron.backup.path }}"
BACKUP_ENABLED
=
true
BACKUP_KEEP_DAYS
={{
hedgedoc.retention_cron.backup.keep_days
}}
BACKUP_PATH
=
/backup/hedgedoc/
BACKUP_KEEP_DAYS
=
60
# override default values if config exists
if
test
-f
/usr/local/etc/hedgedoc-util/hedgedoc-retention-cron.cfg
;
then
.
/usr/local/etc/hedgedoc-util/hedgedoc-retention-cron.cfg
fi
logger
-t
hedgedoc-util
"Running retention cron script"
logger
-t
hedgedoc-util
"Running retention cron script"
...
@@ -21,7 +27,7 @@ while read -r pad owner; do
...
@@ -21,7 +27,7 @@ while read -r pad owner; do
logger
-t
hedgedoc-util
"Processing pad
$pad
"
;
logger
-t
hedgedoc-util
"Processing pad
$pad
"
;
if
[
"
$BACKUP_ENABLED
"
=
true
]
;
then
if
[
"
$BACKUP_ENABLED
"
=
true
]
;
then
hedgedoc-util pad get-content
$pad
>
$BACKUP_PATH
/
$pad
.md
&&
logger
-t
hedgedoc-util
"backup successfull"
hedgedoc-util pad get-content
$pad
>
$BACKUP_PATH
/
$
(
date
+
"%Y%m%d"
)
_
$
pad
.md
&&
logger
-t
hedgedoc-util
"backup successfull"
fi
fi
if
[
"
$MAIL_ENABLED
"
=
true
]
;
then
if
[
"
$MAIL_ENABLED
"
=
true
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment