Skip to content

Commit deb9ceb

Browse files
authored
⚠️ Project renaming to ctfhub ⚠️ (#83)
* complete project renaming -> ctfhub * cleaned last reference to ctfpad * And migration steps in readme
1 parent 0f6523b commit deb9ceb

File tree

106 files changed

+575
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+575
-599
lines changed

.env.example

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
#
2-
# CTFPad
2+
# CTFHub
33
#
4-
CTFPAD_DEBUG=1 # Change here to disable debug mode
5-
CTFPAD_DOMAIN=localhost # Change here to your server public IP / FQDN
6-
CTFPAD_PORT=8000 # Change here to your server public port for CTFPad
7-
CTFPAD_PROTOCOL=http # Change here to 1 if your public server uses https
8-
CTFPAD_SECRET_KEY=74320c04549af3a5f9fd9bc007b2e20ced8 # Change here
9-
CTFPAD_URL=${CTFPAD_PROTOCOL}://${CTFPAD_DOMAIN}:${CTFPAD_PORT}
4+
CTFHUB_DEBUG=1 # Change here to disable debug mode
5+
CTFHUB_DOMAIN=localhost # Change here to your server public IP / FQDN
6+
CTFHUB_PORT=8000 # Change here to your server public port for CTFHub
7+
CTFHUB_PROTOCOL=http # Change here to 1 if your public server uses https
8+
CTFHUB_SECRET_KEY=74320c04549af3a5f9fd9bc007b2e20ced8 # Change here
9+
CTFHUB_URL=${CTFHUB_PROTOCOL}://${CTFHUB_DOMAIN}:${CTFHUB_PORT}
1010

1111

1212
#
13-
# CTFPad Database
13+
# CTFHub Database
1414
#
15-
CTFPAD_DB_HOST=db
16-
CTFPAD_DB_PORT=5432
17-
CTFPAD_DB_NAME=ctfpad # Change here
18-
CTFPAD_DB_USER=ctfpad # Change here
19-
CTFPAD_DB_PASSWORD=1358127ce28271330b266cbf2ff556af13653fb5 # Change here
15+
CTFHUB_DB_HOST=db
16+
CTFHUB_DB_PORT=5432
17+
CTFHUB_DB_NAME=ctfhub # Change here
18+
CTFHUB_DB_USER=ctfhub # Change here
19+
CTFHUB_DB_PASSWORD=1358127ce28271330b266cbf2ff556af13653fb5 # Change here
2020

2121

2222
#
2323
# Hedgedoc settings
2424
#
25-
CTFPAD_HEDGEDOC_PROTOCOL=http
26-
CTFPAD_HEDGEDOC_DOMAIN=localhost
27-
CTFPAD_HEDGEDOC_PORT=3000
28-
CTFPAD_HEDGEDOC_IS_INTERNAL=1
29-
CTFPAD_HEDGEDOC_URL=${CTFPAD_HEDGEDOC_PROTOCOL}://${CTFPAD_HEDGEDOC_DOMAIN}:${CTFPAD_HEDGEDOC_PORT}
25+
CTFHUB_HEDGEDOC_PROTOCOL=http
26+
CTFHUB_HEDGEDOC_DOMAIN=localhost
27+
CTFHUB_HEDGEDOC_PORT=3000
28+
CTFHUB_HEDGEDOC_IS_INTERNAL=1
29+
CTFHUB_HEDGEDOC_URL=${CTFHUB_HEDGEDOC_PROTOCOL}://${CTFHUB_HEDGEDOC_DOMAIN}:${CTFHUB_HEDGEDOC_PORT}
3030

3131

3232
#
33-
# CTFPad Email recovery feature
33+
# CTFHub Email recovery feature
3434
#
3535
# Leave blank or customize below to enable the password recovery feature by email
36-
CTFPAD_EMAIL_SERVER_HOST='' # smtp.gmail.com or mailgun, or sendgrid etc.
37-
CTFPAD_EMAIL_SERVER_PORT=0
38-
CTFPAD_EMAIL_USERNAME=''
39-
CTFPAD_EMAIL_PASSWORD=''
36+
CTFHUB_EMAIL_SERVER_HOST='' # smtp.gmail.com or mailgun, or sendgrid etc.
37+
CTFHUB_EMAIL_SERVER_PORT=0
38+
CTFHUB_EMAIL_USERNAME=''
39+
CTFHUB_EMAIL_PASSWORD=''
4040

4141

4242
#
4343
# Notification webhook URLs
4444
# Leave blank or customize below to disable
4545
#
46-
CTFPAD_DISCORD_WEBHOOK_URL=
46+
CTFHUB_DISCORD_WEBHOOK_URL=
4747

4848

4949
#
5050
# Jitsi settings
5151
#
52-
CTFPAD_JITSI_URL=https://meet.jit.si
52+
CTFHUB_JITSI_URL=https://meet.jit.si
5353

5454

5555
#
@@ -58,4 +58,4 @@ CTFPAD_JITSI_URL=https://meet.jit.si
5858
# By default, use the public instance at excalidraw.com
5959
# To use your own instance, a docker script can be found in `scripts/excalidraw/docker-compose.yml`
6060
#
61-
CTFPAD_EXCALIDRAW_URL=https://excalidraw.com:443
61+
CTFHUB_EXCALIDRAW_URL=https://excalidraw.com:443

.github/workflows/notify.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
● ') }}
2525
2626
color: 0x0000ff
27-
username: ${{ github.actor }} on CTFPad
28-
avatar_url: "https://github.com/hugsy/ctfpad/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"
27+
username: ${{ github.actor }} on CTFHub
28+
avatar_url: "https://github.com/hugsy/ctfhub/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"
2929

3030
- name: Triggering Pull Request Discord Notification
3131
if: github.event_name == 'pull_request' && github.event.action == 'opened' && github.repository_owner == 'hugsy'
@@ -41,8 +41,8 @@ jobs:
4141
---
4242
Link: ${{ github.event.pull_request.html_url }}
4343
color: 0xff0000
44-
username: ${{ github.actor }} on CTFPad
45-
avatar_url: "https://github.com/hugsy/ctfpad/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"
44+
username: ${{ github.actor }} on CTFHub
45+
avatar_url: "https://github.com/hugsy/ctfhub/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"
4646

4747
- name: Triggering Issue Discord Notification
4848
if: github.event_name == 'issues' && github.event.action == 'opened' && github.repository_owner == 'hugsy'
@@ -58,5 +58,5 @@ jobs:
5858
---
5959
Link: ${{ github.event.issue.html_url }}
6060
color: 0x00ff00
61-
username: ${{ github.actor }} on CTFPad
62-
avatar_url: "https://github.com/hugsy/ctfpad/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"
61+
username: ${{ github.actor }} on CTFHub
62+
avatar_url: "https://github.com/hugsy/ctfhub/blob/refresh-readme/static/images/new_logo_circle.png?raw=true"

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ repos:
33
rev: '3.0.6'
44
hooks:
55
- id: djhtml
6-
files: ctfpad/templates/.*\.html$
6+
files: ctfhub/templates/.*\.html$
77

88
- id: djcss
9-
files: static/css/.*\.css$
9+
files: ctfhub/static/css/.*\.css$
1010

1111
- id: djjs
12-
files: static/js/.*\.js$
12+
files: ctfhub/static/js/.*\.js$
1313

1414
- repo: https://github.com/psf/black
1515
rev: '23.3.0'

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<img alt="Logo" src="static/images/new_logo_circle.png" width=20%>
33
</p>
44

5-
<h2 align="center"><b>CTFPad</b></h2>
5+
<h2 align="center"><b>CTFHub</b></h2>
66
<h3 align="center">Where CTFs happen</h3>
77

88
<p align="center">
99
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
10-
<a href="https://github.com/hugsy/ctfpad/blob/master/LICENSE"><img alt="Licence MIT" src="https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic"></a>
10+
<a href="https://github.com/hugsy/ctfhub/blob/master/LICENSE"><img alt="Licence MIT" src="https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic"></a>
1111
<img alt="Python-Version 3.10" src="https://img.shields.io/badge/Python-3.10-brightgreen">
12-
<a href="https://discord.gg/fYsAjvsdQT"><img alt="CTFPad on Discord" src="https://img.shields.io/badge/Discord-CTFPad-purple"></a>
12+
<a href="https://discord.gg/fYsAjvsdQT"><img alt="CTFHub on Discord" src="https://img.shields.io/badge/Discord-CTFHub-purple"></a>
1313
</p>
1414

1515
## What is it?
@@ -47,8 +47,8 @@ A non-exhaustive list of features:
4747
For most people, this will suffice:
4848

4949
```bash
50-
$ git clone https://github.com/hugsy/ctfpad
51-
$ cd ctfpad
50+
$ git clone https://github.com/hugsy/ctfhub
51+
$ cd ctfhub
5252
$ cp .env.example .env
5353
### CHANGE THE CREDENTIALS IN .env ###
5454
$ nano .env
@@ -67,23 +67,26 @@ $ nano scripts/proxy/.env
6767
$ docker compose -f scripts/proxy/docker-compose.yml -f ./docker-compose.yml up -d --build
6868
```
6969

70-
## Gallery
70+
If you're migrating from the first versions called `ctpad`, check out see [PR #83](https://github.com/hugsy/ctfhub/pull/83) to migrate the data to the new environment, search the `Setup > Migration` part.
71+
72+
73+
## Gallery
7174

7275
Check out the [docs](docs/gallery.md)
7376

7477
## Contribution
7578

76-
`CTFPad` was created and maintained by [`@_hugsy_`](https://twitter.com/_hugsy_), but kept fresh thanks to [all the contributors](https://github.com/hugsy/ctfpad/graphs/contributors).
79+
`CTFHub` was created and maintained by [`@_hugsy_`](https://twitter.com/_hugsy_), but kept fresh thanks to [all the contributors](https://github.com/hugsy/ctfhub/graphs/contributors).
7780

78-
[ ![contributors-img](https://contrib.rocks/image?repo=hugsy/ctfpad) ](https://github.com/hugsy/ctfpad/graphs/contributors)
81+
[ ![contributors-img](https://contrib.rocks/image?repo=hugsy/ctfhub) ](https://github.com/hugsy/ctfhub/graphs/contributors)
7982

8083

8184
If you just like the tool, consider dropping on Discord (or Twitter or other) a simple *"thanks"*, it is always very appreciated.
8285

8386
And if you can, consider [sponsoring me](https://github.com/hugsy/sponsors) - it really helps dedicating time and resources to the projects!
8487

8588

86-
## Extra Credits
89+
## Credits and Links
8790

88-
- [CTFPad](https://github.com/StratumAuhuur/CTFPad): nice project but NodeJS, so yeah. Also [`etherpad-lite`](https://yopad.eu) doesn't support MarkDown easily. I like the name, so I took it shamelessly
8991
- The world flag images are downloaded from https://flagpedia.net/
92+
- [CTFHub](https://github.com/StratumAuhuur/CTFHub): NodeJS project that is based on [`etherpad-lite`](https://yopad.eu) (no MarkDown support).

conf/certs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Example with default settings working with the provided `nginx.conf`:
2020
mkcert -install
2121
2222
# Generate a new certificates with the different subdomains:
23-
mkcert ctfpad.mydomain.com hedgedoc.mydomain.com excalidraw.mydomain.com collab.excalidraw.mydomain.com
23+
mkcert ctfhub.mydomain.com hedgedoc.mydomain.com excalidraw.mydomain.com collab.excalidraw.mydomain.com
2424
2525
# Move the generated certificates to the certs folder. Assuming you are at the repository root folder:
2626
mkdir -p ./conf/certs/ctfdad.mydomain.com
27-
mv ctfpad.mydomain.com*-key.pem ./conf/certs/ctfdad.mydomain.com/privkey.pem
28-
mv ctfpad.mydomain.com*.pem ./conf/certs/ctfdad.mydomain.com/fullchain.pem
27+
mv ctfhub.mydomain.com*-key.pem ./conf/certs/ctfdad.mydomain.com/privkey.pem
28+
mv ctfhub.mydomain.com*.pem ./conf/certs/ctfdad.mydomain.com/fullchain.pem
2929
```
3030

31-
If `ctfpad.mydomain.com` is in the `/etc/hosts` file of your machine, then go to `https://ctfpad.mydomain.com` and enjoy the app!
31+
If `ctfhub.mydomain.com` is in the `/etc/hosts` file of your machine, then go to `https://ctfhub.mydomain.com` and enjoy the app!

conf/nginx/nginx.conf

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# Basic nginx reverse proxy configuration for CTFPad + hedgedoc + excalidraw
2+
# Basic nginx reverse proxy configuration for CTFHub + hedgedoc + excalidraw
33
#
44
# This configuration will use nginx as a HTTPS reverse-proxy
5-
# - CTFPad (443 -> 8000)
5+
# - CTFHub (443 -> 8000)
66
# - HedgeDoc (443 -> 3000)
77
# - Excalidraw (443 -> 80)
88
#
@@ -30,26 +30,26 @@ http {
3030
#
3131
server {
3232
listen 80;
33-
server_name ctfpad.mydomain.com hedgedoc.mydomain.com excalidraw.mydomain.com collab.excalidraw.mydomain.com;
33+
server_name ctfhub.mydomain.com hedgedoc.mydomain.com excalidraw.mydomain.com collab.excalidraw.mydomain.com;
3434
return 301 https://$host$request_uri;
3535
}
3636

3737

3838
#
39-
# CTFPad
39+
# CTFHub
4040
#
41-
upstream app_ctfpad_server {
42-
server ctfpad:8000;
41+
upstream app_ctfhub_server {
42+
server ctfhub:8000;
4343
}
4444

4545
server {
4646
listen 443 ssl;
47-
server_name ctfpad.mydomain.com;
48-
ssl_certificate /etc/nginx/certs/ctfpad.mydomain.com/fullchain.pem; # store letsencrypt keys there
49-
ssl_certificate_key /etc/nginx/certs/ctfpad.mydomain.com/privkey.pem; # store letsencrypt keys there
47+
server_name ctfhub.mydomain.com;
48+
ssl_certificate /etc/nginx/certs/ctfhub.mydomain.com/fullchain.pem; # store letsencrypt keys there
49+
ssl_certificate_key /etc/nginx/certs/ctfhub.mydomain.com/privkey.pem; # store letsencrypt keys there
5050

5151
location / {
52-
proxy_pass http://app_ctfpad_server;
52+
proxy_pass http://app_ctfhub_server;
5353
proxy_redirect off;
5454
proxy_set_header Host $host;
5555
proxy_set_header X-Real-IP $remote_addr;
@@ -76,8 +76,8 @@ http {
7676
server {
7777
listen 443 ssl;
7878
server_name hedgedoc.mydomain.com;
79-
ssl_certificate /etc/nginx/certs/ctfpad.mydomain.com/fullchain.pem; # store letsencrypt keys there
80-
ssl_certificate_key /etc/nginx/certs/ctfpad.mydomain.com/privkey.pem; # store letsencrypt keys there
79+
ssl_certificate /etc/nginx/certs/ctfhub.mydomain.com/fullchain.pem; # store letsencrypt keys there
80+
ssl_certificate_key /etc/nginx/certs/ctfhub.mydomain.com/privkey.pem; # store letsencrypt keys there
8181

8282
location / {
8383
proxy_pass http://app_hedgedoc_server;
@@ -116,8 +116,8 @@ http {
116116
server {
117117
listen 443 ssl;
118118
server_name excalidraw.mydomain.com;
119-
ssl_certificate /etc/nginx/certs/ctfpad.mydomain.com/fullchain.pem; # store letsencrypt keys there
120-
ssl_certificate_key /etc/nginx/certs/ctfpad.mydomain.com/privkey.pem; # store letsencrypt keys there
119+
ssl_certificate /etc/nginx/certs/ctfhub.mydomain.com/fullchain.pem; # store letsencrypt keys there
120+
ssl_certificate_key /etc/nginx/certs/ctfhub.mydomain.com/privkey.pem; # store letsencrypt keys there
121121

122122
location / {
123123
proxy_pass http://app_excalidraw_server;
@@ -145,8 +145,8 @@ http {
145145
server {
146146
listen 443 ssl;
147147
server_name collab.excalidraw.mydomain.com;
148-
ssl_certificate /etc/nginx/certs/ctfpad.mydomain.com/fullchain.pem; # store letsencrypt keys there
149-
ssl_certificate_key /etc/nginx/certs/ctfpad.mydomain.com/privkey.pem; # store letsencrypt keys there
148+
ssl_certificate /etc/nginx/certs/ctfhub.mydomain.com/fullchain.pem; # store letsencrypt keys there
149+
ssl_certificate_key /etc/nginx/certs/ctfhub.mydomain.com/privkey.pem; # store letsencrypt keys there
150150

151151
location / {
152152
proxy_pass http://app_excalidraw_room_server;

ctfhub/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default_app_config = "ctfhub.apps.CtfhubConfig"

ctfpad/admin.py ctfhub/admin.py

File renamed without changes.

ctfpad/apps.py ctfhub/apps.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from django.utils.translation import gettext_lazy as _
33

44

5-
class CtfpadConfig(AppConfig):
6-
name = "ctfpad"
7-
verbose_name = _("ctfpad")
5+
class CtfhubConfig(AppConfig):
6+
name = "ctfhub"
7+
verbose_name = _("ctfhub")
88

99
def ready(self):
10-
import ctfpad.signals
10+
import ctfhub.signals
File renamed without changes.
File renamed without changes.

ctfpad/decorators/user.py ctfhub/decorators/user.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
from django.contrib import messages
12
from django.http.request import HttpRequest
23
from django.shortcuts import redirect
3-
from django.contrib import messages
4-
from django.utils.http import urlencode
54
from django.urls import reverse
5+
from django.utils.http import urlencode
66

77

88
def is_not_authenticated(view_func):
@@ -29,7 +29,7 @@ def wrapper_func(request: HttpRequest, *args, **kwargs):
2929
if not request.user.is_authenticated:
3030
messages.warning(request, "You must be authenticated!")
3131
return redirect(
32-
reverse("ctfpad:user-login")
32+
reverse("ctfhub:user-login")
3333
+ "?"
3434
+ urlencode({"redirect_to": request.path})
3535
)

ctfpad/forms.py ctfhub/forms.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import json
2-
from django.contrib.auth.forms import UserChangeForm
3-
from django.contrib.auth.models import User
4-
5-
from django import forms
6-
from django.core.exceptions import ValidationError
7-
from django.forms import widgets
82

9-
from ctfpad.models import (
3+
from ctfhub.models import (
104
Challenge,
115
ChallengeCategory,
126
ChallengeFile,
@@ -15,6 +9,11 @@
159
Tag,
1610
Team,
1711
)
12+
from django import forms
13+
from django.contrib.auth.forms import UserChangeForm
14+
from django.contrib.auth.models import User
15+
from django.core.exceptions import ValidationError
16+
from django.forms import widgets
1817

1918

2019
class UserUpdateForm(UserChangeForm):

0 commit comments

Comments
 (0)