Skip to content

ozgrozer/jaydon

Repository files navigation

jaydon

tag license

Nginx Control Panel

This is an experimental control panel written for a niche reason. Use at your own risk.

Quick Installation

Ubuntu v24

curl -L https://raw.githubusercontent.com/ozgrozer/jaydon/master/install24.sh | bash

Ubuntu v22

curl -L https://raw.githubusercontent.com/ozgrozer/jaydon/master/install22.sh | bash

Before Installation

Unlike other control panels with Jaydon you control the versions of your softwares such as Nginx, Node.js etc.

Before you install Jaydon you need:

Ubuntu v24

# Install essential tools
sudo apt-get update
sudo apt-get install build-essential -y

# Install MongoDB
sudo apt-get install gnupg curl -y
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update
sudo apt install mongodb-org -y
sudo systemctl start mongod
sudo systemctl enable mongod

# Install Certbot
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

# Install Nginx
sudo apt install nginx -y

# Install Git
sudo apt install git -y

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs -y

# Install Yarn
sudo npm i -g yarn

# Install PM2
sudo npm i -g pm2

Ubuntu v22

# Install essential tools
sudo apt-get update
sudo apt-get install build-essential -y

# Install MongoDB
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install mongodb-org -y
sudo systemctl start mongod
sudo systemctl enable mongod

# Install Certbot
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot -y
sudo ln -s /snap/bin/certbot /usr/bin/certbot

# Install Nginx
sudo apt install nginx -y

# Install Git
sudo apt install git -y

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs -y

# Install Yarn
sudo npm i -g yarn

# Install PM2
sudo npm i -g pm2

Installation

If you have all the dependencies above now you can install Jaydon.

# Clone Git repository
git clone https://github.com/ozgrozer/jaydon.git && cd jaydon

# Install dependencies
yarn install

# Build React app
yarn build

# Create necessary database tables
yarn run first-run

# Start server with PM2
pm2 start ./src/backend/server.js --name jaydon
pm2 startup
pm2 save

# Open your browser and go to
http://your-ip:1148

Update

Make sure update.sh is executable.

chmod +x update.sh

And just run it.

./update.sh

API

Jaydon API built on REST. It accepts requests as JSON and returns responses as JSON too.

Base URL.

http://your-ip:1148/api/v1

Example POST request.

{
  "meta": {
    "apiKey": "YOUR_API_KEY",
    "category": "domain|cronJob",
    "event": "create|read|update|delete"
  },
  "data": {
  }
}

"data" object.

// create domain
"data": {
  "domain": "example.com",
  "gitSupport": true,
  "sslSupport": true,
  "nginxConf": "configuration"
}

// read a domain
"data": {
  "id": "domain id"
}
// read domains
"data": {
}

// update domain
"data": {
  "id": "domain id",
  "domain": "example.com",
  "gitSupport": false,
  "sslSupport": false,
  "nginxConf": "configuration"
}

// delete domain
"data": {
  "id": "domain id"
}

---

// create cron job
"data": {
  "command": "node script.js",
  "schedule": "* * * * *"
}

// read a cron job
"data": {
  "id": "cron job id"
}
// read cron jobs
"data": {
}

// update cron job
"data": {
  "id": "cron job id",
  "command": "node script.js",
  "schedule": "* * * * *"
}

// delete cron job
"data": {
  "id": "cron job id"
}

Example 1: Create a domain with cURL.

curl http://your-ip:1148/api/v1 \
-X POST \
-H "Content-Type: application/json" \
--data-binary @- << EOF
{
  "meta": { "apiKey": "YOUR_API_KEY", "category": "domain", "event": "create" },
  "data": { "domain": "test.com", "gitSupport": false }
}
EOF
# {"success":true}
# {"success":false,"error":"error"}

Example 2: Update a cron job with Axios.

const axios = require('axios')

const postUrl = 'http://your-ip:1148/api/v1'
const postData = {
  meta: { apiKey: 'YOUR_API_KEY', category: 'cronJob', event: 'update' },
  data: { id: 'CRON_JOB_ID', command: '/usr/bin/node ~/script.js', schedule: '0 * * * *' }
}
axios
  .post(postUrl, postData)
  .then(res => {
    console.log(res.data)
    // {"success":true}
    // {"success":false,"error":"error"}
  })
  .catch(err => {
    console.log(err)
  })

Preview

Todo

  • Domains
  • Git
  • SSL
  • Cron Jobs
  • DNS
  • Logs
  • Monitor
  • API

Contribution

Feel free to contribute. Open a new issue, or make a pull request.

License

MIT

About

Nginx control panel

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors