Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
0226ee01
Commit
0226ee01
authored
Nov 09, 2022
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peertube: Add crontab service and enabled database backup
parent
72326142
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
0 deletions
+108
-0
software/peertube/buildout.hash.cfg
software/peertube/buildout.hash.cfg
+16
-0
software/peertube/instance.cfg.in
software/peertube/instance.cfg.in
+48
-0
software/peertube/software.cfg
software/peertube/software.cfg
+25
-0
software/peertube/template-crontab-line.in
software/peertube/template-crontab-line.in
+2
-0
software/peertube/template-crontab.in
software/peertube/template-crontab.in
+2
-0
software/peertube/template-dcron-service.sh.in
software/peertube/template-dcron-service.sh.in
+11
-0
software/peertube/template-peertube-backup.sh.in
software/peertube/template-peertube-backup.sh.in
+4
-0
No files found.
software/peertube/buildout.hash.cfg
View file @
0226ee01
...
...
@@ -31,3 +31,19 @@ filename = template-peertube.yaml.in
[template-nginx-configuration]
filename = template-nginx.cfg.in
# md5sum = 6b11e79bcc7734d8629e1b6e6cb497e1
[template-dcron-service]
filename = template-dcron-service.sh.in
# md5sum = 851262d7174da868805cb7c8e1ced7c0
[template-crontab-line]
filename = template-crontab-line.in
# md5sum = 5cbd64f04da0601ba4286516a6161f5e
[template-crontab]
filename = template-crontab.in
# md5sum = f1f82101258de19068262b7213fc478b
[template-peertube-backup-script]
filename = template-peertube-backup.sh.in
# md5sum = ae4a0043414336a521b524d9c95f1c68
software/peertube/instance.cfg.in
View file @
0226ee01
...
...
@@ -11,6 +11,11 @@ parts =
peertube-service
publish-connection-parameter
peertube-urlparse
dcron-service
activate-crontab-file
peertube-backup-cron
peertube-database-resiliency-after-import-script
peertube-database-resiliency-exclude-file
nginx-listen-promise
peertube-listen-promise
...
...
@@ -26,6 +31,10 @@ var = $${buildout:directory}/var
log = $${:var}/log
run = $${:var}/run
www = $${:var}/www
crontabs = $${:etc}/crontabs
cron-entries = $${:etc}/cron.d
cronstamps = $${:etc}/cronstamps
cron-lines = $${:etc}/cron.lines
nginx = $${:etc}/nginx
peertube_nginx_log = $${:log}/nginx
varnginx = $${:var}/nginx
...
...
@@ -144,6 +153,45 @@ config-command = $${service-redis:promise-wrapper}
log = $${redis:log}/*.log
name = redis
#################################
# Cron service
#################################
[dcron-service]
recipe = slapos.recipe.template
url = ${template-dcron-service:output}
output = $${directory:services}/crond
logfile = $${directory:log}/crond.log
[peertube-backup-script]
recipe = slapos.recipe.template
url = ${template-peertube-backup-script:output}
output = $${directory:etc}/$${:_buildout_section_name_}
[peertube-backup-cron]
recipe = slapos.recipe.template
url = ${template-crontab-line:output}
output = $${directory:cron-lines}/$${:_buildout_section_name_}
script = $${peertube-backup-script:output}
frequency = daily
[activate-crontab-file]
# XXX File is never removed
recipe = plone.recipe.command
stop-on-error = true
command = ${coreutils-output:cat} ${template-crontab:output} $${peertube-backup-cron:output} | ${dcron-output:crontab} -c $${directory:crontabs} -
[peertube-database-resiliency-exclude-file]
recipe = slapos.recipe.template:jinja2
inline = {{ "$${postgresql:pgdata-directory}/**" }}
output = $${directory:srv}/exporter.exclude
[peertube-database-resiliency-after-import-script]
recipe = collective.recipe.template
input = inline: #!/bin/sh
$${postgresql:bin}/pg_restore -c -C -d postgres $${directory:peertube_directory}//peertube_prod-dump.db
output = $${directory:srv}/runner-import-restore
mode = 755
#################################
# SlapOS service
#################################
...
...
software/peertube/software.cfg
View file @
0226ee01
...
...
@@ -14,6 +14,7 @@ extends =
# In this example we extend from helloweb component.
../../component/unzip/buildout.cfg
../../component/curl/buildout.cfg
../../component/dcron/buildout.cfg
../../component/vim/buildout.cfg
../../component/nodejs/buildout.cfg
../../component/yarn/buildout.cfg
...
...
@@ -30,11 +31,15 @@ extends =
../../component/redis/buildout.cfg
../../component/git/buildout.cfg
../../component/wget/buildout.cfg
# backup
../../component/rdiff-backup/buildout.cfg
../../component/rsync/buildout.cfg
parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
# in 99,9% of Slapos Software Releases)
slapos-cookbook
dcron
gcc
unzip
curl
...
...
@@ -106,3 +111,23 @@ output = ${buildout:directory}/${:filename}
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
[template-dcron-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
[template-crontab-line]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
[template-crontab]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
[template-peertube-backup-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
software/peertube/template-crontab-line.in
0 → 100644
View file @
0226ee01
# $${:_buildout_section_name_}
$${:frequency} $${:script}
software/peertube/template-crontab.in
0 → 100644
View file @
0226ee01
# min(0-59) hours(0-23) day(1-31) month(1-12) dow(0-7) command
MAILTO=admins@erp5.org
software/peertube/template-dcron-service.sh.in
0 → 100644
View file @
0226ee01
#!${dash-output:dash}
# BEWARE: This file is operated by slapos node
# BEWARE: It will be overwritten automatically
exec ${dcron-output:crond} \
-s $${directory:cron-entries} \
-c $${directory:crontabs} \
-t $${directory:cronstamps} \
-f -l 5 \
-L $${dcron-service:logfile}
# -M cron_simplelogger
software/peertube/template-peertube-backup.sh.in
0 → 100644
View file @
0226ee01
echo "Hello Peertube"
# Dump the databse
$${postgresql:bin}/pg_dump -Fc peertube_prod > $${directory:peertube_directory}/peertube_prod-dump.db
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment