Skip to content

Commit

Permalink
rename services
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Oct 27, 2024
1 parent 0010d7f commit 4398338
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 30 deletions.
7 changes: 3 additions & 4 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ TODO
You might want to look at some logs while administrating or developing the dojo.
The most useful logs are:

- **dojo-init:** `journalctl -b -u dojo-init`
- **dojo up:** `journalctl -b -u dojo-up`
- **ctfd:** `docker logs ctfd"
- **nginx:** `docker logs nginx-proxy"
- **dojo:** `journalctl -b -u dojo.*`
- **ctfd:** `docker logs ctfd`
- **nginx:** `docker logs nginx-proxy`

All of these should be run inside the outer docker.
If you are outside of the outer docker (e.g., on the host itself), you can do stuff like `docker exec dojo journalctl -b -u dojo-up`.
32 changes: 16 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ RUN git clone --branch 3.6.0 https://github.com/CTFd/CTFd /opt/CTFd
RUN echo 'tmpfs /run/dojofs tmpfs defaults,mode=755,shared 0 0' > /etc/fstab && \
echo '/data/homes /run/homefs none defaults,bind,nosuid 0 0' >> /etc/fstab

RUN ln -s /opt/pwn.college/etc/systemd/system/dojo-up.service /etc/systemd/system/dojo-up.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo-init.service /etc/systemd/system/dojo-init.service && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.backup.service /etc/systemd/system/pwn.college.backup.service && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.backup.timer /etc/systemd/system/pwn.college.backup.timer && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.cachewarmer.service /etc/systemd/system/pwn.college.cachewarmer.service && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.cachewarmer.timer /etc/systemd/system/pwn.college.cachewarmer.timer && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.imagepuller.service /etc/systemd/system/pwn.college.imagepuller.service && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.imagepuller.timer /etc/systemd/system/pwn.college.imagepuller.timer && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.cloud.backup.service /etc/systemd/system/pwn.college.cloud.backup.service && \
ln -s /opt/pwn.college/etc/systemd/system/pwn.college.cloud.backup.timer /etc/systemd/system/pwn.college.cloud.backup.timer && \
ln -s /etc/systemd/system/dojo-init.service /etc/systemd/system/multi-user.target.wants/dojo-init.service && \
ln -s /etc/systemd/system/dojo-up.service /etc/systemd/system/multi-user.target.wants/dojo-up.service && \
ln -s /etc/systemd/system/pwn.college.backup.timer /etc/systemd/system/timers.target.wants/pwn.college.backup.timer && \
ln -s /etc/systemd/system/pwn.college.cachewarmer.timer /etc/systemd/system/timers.target.wants/pwn.college.cachewarmer.timer && \
ln -s /etc/systemd/system/pwn.college.imagepuller.timer /etc/systemd/system/timers.target.wants/pwn.college.imagepuller.timer && \
ln -s /etc/systemd/system/pwn.college.cloud.backup.timer /etc/systemd/system/timers.target.wants/pwn.college.cloud.backup.timer
RUN ln -s /opt/pwn.college/etc/systemd/system/dojo.up.service /etc/systemd/system/dojo.up.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.init.service /etc/systemd/system/dojo.init.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.backup.service /etc/systemd/system/dojo.backup.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.backup.timer /etc/systemd/system/dojo.backup.timer && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.cachewarmer.service /etc/systemd/system/dojo.cachewarmer.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.cachewarmer.timer /etc/systemd/system/dojo.cachewarmer.timer && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.imagepuller.service /etc/systemd/system/dojo.imagepuller.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.imagepuller.timer /etc/systemd/system/dojo.imagepuller.timer && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.cloud.backup.service /etc/systemd/system/dojo.cloud.backup.service && \
ln -s /opt/pwn.college/etc/systemd/system/dojo.cloud.backup.timer /etc/systemd/system/dojo.cloud.backup.timer && \
ln -s /etc/systemd/system/dojo.init.service /etc/systemd/system/multi-user.target.wants/dojo.init.service && \
ln -s /etc/systemd/system/dojo.up.service /etc/systemd/system/multi-user.target.wants/dojo.up.service && \
ln -s /etc/systemd/system/dojo.backup.timer /etc/systemd/system/timers.target.wants/dojo.backup.timer && \
ln -s /etc/systemd/system/dojo.cachewarmer.timer /etc/systemd/system/timers.target.wants/dojo.cachewarmer.timer && \
ln -s /etc/systemd/system/dojo.imagepuller.timer /etc/systemd/system/timers.target.wants/dojo.imagepuller.timer && \
ln -s /etc/systemd/system/dojo.cloud.backup.timer /etc/systemd/system/timers.target.wants/dojo.cloud.backup.timer

WORKDIR /opt/pwn.college
COPY . .
Expand Down
6 changes: 3 additions & 3 deletions dojo/dojo
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ case "$ACTION" in

# HELP: logs: display dojo logs
"logs")
journalctl -u pwn.college -f --no-tail
journalctl -u dojo.* -f --no-tail
;;

# HELP: wait: wait for the dojo to finish starting
"wait")
dojo logs | while IFS= read -r line; do
echo "$line"
case "$line" in
*"Finished pwn.college.service - pwn.college docker compose service"*)
*"Finished dojo.up.service - dojo docker compose service"*)
exit 0
;;
*"Failed to start pwn.college.service - pwn.college docker compose service."*)
*"Failed to start dojo.up.service - dojo docker compose service."*)
exit 1
;;
esac
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Create a pwn.college backup
Description=Create a dojo backup

[Service]
Type=simple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Timer to run pwn.college local backup service
Description=Timer to run dojo local backup service

[Timer]
OnCalendar=hourly
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Keep the pwn.college caches warm!
Description=Keep the dojo caches warm!

[Service]
Type=simple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Timer to run pwn.college imagepuller service
Description=Timer to run dojo cachewarmer service

[Timer]
OnCalendar=*-*-* *:*:00
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Upload a pwn.college backup to cloud (at this time just an S3 bucket).
Description=Upload a dojo backup to cloud (at this time just an S3 bucket).

[Service]
Type=simple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Timer to run pwn.college cloud backup service
Description=Timer to run dojo cloud backup service

[Timer]
OnCalendar=daily
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Timer to run pwn.college cachewarmer service
Description=Timer to run dojo imagepuller service

[Timer]
OnCalendar=*-*-* *:*:00
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 4398338

Please sign in to comment.