TinyActive / cosmos-servapps-official

Repository for Cosmos apps on the market by ManhtuongDev ReadMorr
https://github.com/TinyActive/cosmos-servapps
GNU Affero General Public License v3.0
2 stars 1 forks source link

CTFd Full Support #25

Closed vncloudsco closed 11 months ago

vncloudsco commented 1 year ago

Is your feature request related to a software? Please describe.

CTFd is a Capture The Flag framework focusing on ease of use and customizability. It comes with everything you need to run a CTF and it's easy to customize with plugins and themes.

Describe the solution you'd like

No

Link to docker hub or docker compose file on github

https://github.com/CTFd/CTFd/blob/master/docker-compose.yml

Additional context

No

vncloudsco commented 1 year ago

try this code

{
  "cosmos-installer": {},
    "minVersion": "0.8.0",
    "services": {
      "{ServiceName}": {
        "image": "ctfd/ctfd",
        "container_name": "{ServiceName}",
        "hostname": "{ServiceName}",
        "volumes": [
          {
            "source": "{ServiceName}-CTFd-LOG",
            "target": "/var/log/CTFd",
            "type": "volume"
          },
          {
            "source": "{ServiceName}-ctf-uploads",
            "target": "/var/uploads",
            "type": "volume"
          }
        ],
        "environment": [
          "UPLOAD_FOLDER=/var/uploads",
          "DATABASE_URL=mysql+pymysql://ctfd:{Passwords.1}@{ServiceName}-db/ctfd",
          "WORKERS=10",
          "LOG_FOLDER=/var/log/CTFd",
          "REVERSE_PROXY=true",
          "SECRET_KEY=Z2X8y&mMCwi8X&fD"
        ],
        "networks": {
            "{ServiceName}": {}
          },
          "labels": {
            "cosmos-persistent-env": "DB_PASSWORD, DB_HOST, DB_PORT, DB_USERNAME",
            "cosmos-force-network-secured": "true",
            "cosmos-auto-update": "true",
            "cosmos-icon": "https://comos.manhtuong.net/servapps/Monica/icon.png"
          },
        "routes": [{
            "name": "{ServiceName}",
            "description": "Expose {ServiceName} to the web",
            "useHost": true,
            "target": "http://{ServiceName}:8000",
            "mode": "SERVAPP",
            "Timeout": 14400000,
            "ThrottlePerMinute": 12000,
            "BlockCommonBots": true,
            "SmartShield": {
                "Enabled": true
            }
        }]

      },
      "{ServiceName}-db": {
        "image": "docker.io/bitnami/mariadb:11.1",
        "container_name": "{ServiceName}-db",
        "hostname": "{ServiceName}-db",
        "restart": "unless-stopped",
        "networks": {
            "{ServiceName}": {}
          },
        "volumes": [
          {
            "source": "{ServiceName}-db",
            "target": "/bitnami/mariadb",
            "type": "volume"
          }
        ],
        "environment": [
          "MARIADB_DATABASE=ctfd",
          "MARIADB_USER=ctfd",
          "MARIADB_PASSWORD={Passwords.1}",
          "MARIADB_ROOT_PASSWORD={Passwords.2}"
        ],
        "labels": {
          "cosmos-persistent-env": "MARIADB_DATABASE, MARIADB_USER, MARIADB_PASSWORD, MARIADB_ROOT_PASSWORD",
          "cosmos-force-network-secured": "true"
        }
      }
    },
    "networks": {
        "{ServiceName}": {}
      }
  }