diff --git a/docusaurus.config.js b/docusaurus.config.js index 7b680d0..ce94720 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -104,7 +104,7 @@ module.exports = { "@docusaurus/preset-classic", { docs: { - lastVersion: "0.9.1", + lastVersion: "0.10", // Please change this to your repo. editUrl: "https://github.com/ControlPanel-gg/docs/tree/main/", }, diff --git a/static/img/userguides/themes-page.png b/static/img/userguides/themes-page.png new file mode 100644 index 0000000..3e2e3e6 Binary files /dev/null and b/static/img/userguides/themes-page.png differ diff --git a/versioned_docs/version-0.10/Contributing/CTRLPanel Test.md b/versioned_docs/version-0.10/Contributing/CTRLPanel Test.md new file mode 100644 index 0000000..7f6d5c7 --- /dev/null +++ b/versioned_docs/version-0.10/Contributing/CTRLPanel Test.md @@ -0,0 +1,48 @@ +--- +sidebar_position: 4 +--- + +:::info + +Please only use CTRLPanel installations that are not modifyed by plugins/modules/scripts or themes. + +::: + +This repository is using the playwright framework to provide E2E to help developers of the project to speed up development and provide a more stable and secure product. +In case you wanna help by adding some tests, playwright got a awsome documentaion [here](https://playwright.dev/docs/intro) but here are some basics we already took care of so you can start right away. + +## Setup +### Requirements +- A setup version of CTRLPanel with the version you wanna test +- A admin account & a user account on this panel +- Basic knowlage of JS (or TS) +- NodeJS 18+ + +### Instructions +1: clone [this](https://github.com/Ctrlpanel-gg/ctrlpanel-tests) repo +2: run `npm install` to install modules +3: run `npx playwright install` to install playwright browsers +4: rename .env.example to .env +5: populate .env with your data +6: you are ready to go + +## Testing +### CLI +`´npx playwright test` +### UI +`npx playwright test --ui` + +## Write your own tests +### Simple rules +Because you need to be logged in for almost everything, we already took care of this. +Playwright tests are loaded by regex matches. +To create a test that runs on a user account, name it like so: +```shell +[What is the test testing].[Permissions].[What is this file].js +``` +So for example: **server.user.test.js** (Testing servers, with a user account, and its a test) +We setup a _admin_ and _user_ test env this way. + +### Make the test +Playwright comes with a codegen funktion `npx playwright codegen`. +With this its easy to get the selection of elements you want quickly and then write the test. \ No newline at end of file diff --git a/versioned_docs/version-0.10/Contributing/_category_.json b/versioned_docs/version-0.10/Contributing/_category_.json new file mode 100644 index 0000000..f0d550e --- /dev/null +++ b/versioned_docs/version-0.10/Contributing/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Contributing", + "position": 4 +} diff --git a/versioned_docs/version-0.10/Contributing/contributing.md b/versioned_docs/version-0.10/Contributing/contributing.md new file mode 100644 index 0000000..1156c94 --- /dev/null +++ b/versioned_docs/version-0.10/Contributing/contributing.md @@ -0,0 +1,40 @@ +--- +sidebar_position: 1 +--- + +# Contributing +When contributing to this repository, please go through the open issues to see if you can contribute to something. Suppose you want to contribute something that is not in the issues; you can make an issue and wait for a response from the dev team. + +Please note, we have a code of conduct; please follow it in all your interactions with the project. + +## Pull request process + +1. Give your PR a good descriptive title to immediately view what the PR is about. +2. The dev team will look at your code and approve/merge when possible. +3. Make sure your PR follows our code of conduct and coding style. + +## Code of Conduct + +### Our Pledge +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +### Coding Style + +We are following the PSR12 code standard for PHP. + +### Our Standards +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing other's private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting diff --git a/versioned_docs/version-0.10/Contributing/donating.md b/versioned_docs/version-0.10/Contributing/donating.md new file mode 100644 index 0000000..829c218 --- /dev/null +++ b/versioned_docs/version-0.10/Contributing/donating.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 2 +--- + +# Donating +Are you enjoying the ctrlpanel? Feeling generous? Well, help me and contributors purchase pizza to continue working on the ctrlpanel without empty stomachs! + +Your donations go a long way in helping us develop this ctrlpanel, but please don't feel obligated to.
+I will try to mention any donation above €1- in our Discord server. + +## Donator Roles +**Ruby Supporter** €50,- +
+**Gold Supporter** €25,- +
+**Silver Supporter** €15,- +
+**Bronze Supporter** €5,- +
+_All Donators with a supporter role will also have access to a Donators Only channel_ + +Every person that donates above €25- will also get a special place in this document to advertise their site
+Ko-fi link: [https://ko-fi.com/1day2die](https://ko-fi.com/1day2die) +_Please notify me when you've donated, so I can respond quicker :) **1Day2Die#6718**_ + +## Donators + + +❤️ Ruby Supporter: **BolverBlitz#4881**
+❤️ Ruby Supporter: **ccrs#4120**
+❤️ Ruby Supporter: **Timo#4042**
+❤️ Ruby Supporter: **Sir Maddigan#0243**
+ +💛 Gold Supporter: **Wynn#1000**
+💛 Gold Supporter: **dragocz#0191**
+💛 Gold Supporter: **Niktix#3749** [TIX-Hosting](https://tix-hosting.net/)
+💛 Gold Supporter: **DerHorschty#3855**
+ +🤍 Silver Supporter: **TheFrodoDE#1337**
+ +🤎 Bronze Supporter: **Grosenberger#5417**
+🤎 Bronze Supporter: **ojacz#5091**
+🤎 Bronze Supporter: **Coconut#7171**
+🤎 Bronze Supporter: **Bazim#0485**
+🤎 Bronze Supporter: **Jonas.#9915**
+🤎 Bronze Supporter: **Vysoký Vagón#3796**
+🤎 Bronze Supporter: **I got 2 phones#8225**
+🤎 Bronze Supporter: **2IceCube#7992**
+🤎 Bronze Supporter: **ᴅᴏᴍɪɴɪᴋ#1005**
+🤎 Bronze Supporter: **DWAA#1660**
+🤎 Bronze Supporter: **ukcai#7121**
diff --git a/versioned_docs/version-0.10/Contributing/translate.md b/versioned_docs/version-0.10/Contributing/translate.md new file mode 100644 index 0000000..953db99 --- /dev/null +++ b/versioned_docs/version-0.10/Contributing/translate.md @@ -0,0 +1,42 @@ +--- +sidebar_position: 3 +--- + +# Translating + +You can speak your mother tongue?
+You understand a certain language very well?
+Then we need exactly **you for our translator team!**
+ +After a long wait, the Ctrlpanel has now been equipped with a translation system.
+ +_Now we need people who help us translate!_
+ +## How to help + +The Translation list can be found here +https://crowdin.com/project/controlpanelgg + +On this Website you will see every language we need to translate and the current progress. +Feel free to contribute or correct any language you know. + +If you have a suggestion for a language or want to bring in your skills on a certain language, feel free to contact us on discord! + +## Translators + +:de: German: **1Day2Die#0849**
+:de: German: **BolverBlitz#4881**
+:it: Italian: **Dotto#8067**
+🇨🇳 Chinese: **Wynn#1314**
+🇨🇳 Chinese: **vlssu#9657**
+🇪🇸 Spanish: **JouRambo#1734**
+🇫🇷 French: **Paulon#9413**
+🇫🇷 French: **Loulou#0088**
+🇮🇳 Hindi: **Anas.#8899**
+🇮🇳 Hindi: **Abraar#7724**
+🇳🇱 Dutch: **Finniedj.exe#9075**
+🇳🇱 Dutch: **EzedOn#6947**
+🇵🇱 Polish: **mibek1011#1318**
+🇷🇺 Russian: **Namaker#2531**
+🇸🇪 Swedish: **Vermium#9649**
+🇵🇹 Portuguese: **Ferks#7575**
diff --git a/versioned_docs/version-0.10/Guides/_category_.json b/versioned_docs/version-0.10/Guides/_category_.json new file mode 100644 index 0000000..b6d4772 --- /dev/null +++ b/versioned_docs/version-0.10/Guides/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Guides", + "position": 4 +} diff --git a/versioned_docs/version-0.10/Guides/backups.md b/versioned_docs/version-0.10/Guides/backups.md new file mode 100644 index 0000000..49287c8 --- /dev/null +++ b/versioned_docs/version-0.10/Guides/backups.md @@ -0,0 +1,91 @@ +--- +sidebar_position: 2 +--- + +# Database backups + +All important data is stored in the database. This includes all servers, users, and other information. +It's important to keep backups of your database to ensure that you can restore your panel if something goes wrong. + +import TOCInline from '@theme/TOCInline'; + + + +### How to back up + +You can use MySQL dump to back up your database. +This command will create a backup file in the `/var/www/controlpanel/` folder. + +```bash +mysqldump -u root -p controlpanel > /var/www/controlpanel/backup.sql +``` + +### How to restore + +To restore a backup, you need a fresh database. If you already have a database, you can use the following command to drop it. + +:::warning + +Warning, this will delete all Controlpanel related data! Make sure your database is backed up before continuing. +```bash +mysql -u root -p controlpanel -e "DROP DATABASE controlpanel" +``` + +::: + +Then you can restore the backup. You can also restore the backup on any other new server. + +```bash +mysql -u root -p +CREATE DATABASE controlpanel; +CREATE USER 'controlpaneluser'@'127.0.0.1' IDENTIFIED BY 'USE_YOUR_OWN_PASSWORD'; +GRANT ALL PRIVILEGES ON controlpanel.* TO 'controlpaneluser'@'127.0.0.1'; +FLUSH PRIVILEGES; +exit +mysql -u root -p controlpanel < /var/www/controlpanel/backup.sql +``` + +If you have a backup from an older version of ControlPanel, you have to migrate the database to the latest version. + +```bash +cd /var/www/controlpanel +sudo php artisan migrate --seed --force +``` + +### How to automatically backup + +You can automatically back up your database every day at midnight, for example. +First, create a read only user for the database. + +```bash +mkdir -p /var/www/controlpanel/backups +mysql -u root -p +CREATE USER 'controlpanelbackupuser'@'127.0.0.1' IDENTIFIED BY 'USE_YOUR_OWN_PASSWORD'; +GRANT LOCK TABLES, SELECT ON controlpanel.* TO 'controlpanelbackupuser'@'127.0.0.1'; +FLUSH PRIVILEGES; +exit +``` + +Then create a cronjob to run the following command at midnight. +Run `crontab -e` and add the following line: + +```bash +0 0 * * * mysqldump -u controlpanelbackupuser --password= --single-transaction --quick --lock-tables=false controlpanel > /var/www/controlpanel/backups-$(date +\%F).sql +``` + +This will create a backup at /var/www/controlpanel/backups-$(date +\%F).sql every day at midnight. +Every file will have the date when it was made in the filename, so you can also resolve issues that happened a few days ago. + +## Appliaction key +The application key is used to encrypt the data in the database, if its lost you will not be able to decrypt the data in the database. + +### Backup the application key +To backup the appliaction key you need to get it from the .env file +you can get there with this command: +```nano /var/www/controlpanel/.env``` +keep this key safe you will need later! + +### Restore the application key +After you have reinstalled the panel go back into the .env +```nano /var/www/controlpanel/.env``` +You can then change the new key with the old key! diff --git a/versioned_docs/version-0.10/Guides/products.md b/versioned_docs/version-0.10/Guides/products.md new file mode 100644 index 0000000..5d15c6b --- /dev/null +++ b/versioned_docs/version-0.10/Guides/products.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 1 +--- + +# Products + +import DocusaurusImageUrl from '@site/static/img/docusaurus.png'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +With products, you can configure the resources allocated to new servers created on your panel. You can set the custom pricing and link products to specific nodes and eggs. +You can check out the pterodactyl server creation page for more information about the specific options like CPU and IO. + + + +### Credits System +Credits are charged hourly based on the monthly price you've configured (price / 30 / 24) +This means that the price of your products won’t be charged right away when the user creates a server, but instead, the credits are reduced hourly—giving the user the option to cancel and create servers freely anytime. +When the user runs out of credits, his server will automatically be suspended. + + +## Product Linking +
+Example of making a product for Minecraft servers. + +### Information +Product linking allows you to configure the nodes and eggs this product can be a used on. +For example, you have a node that is more powerful than another node, you may most likely want to charge a bit extra for the usage of this node. +Or you may have a node dedicated for Minecraft hosting and another node for discord bots. Using the node and egg links, you can easily keep your pricing and server creation separated. + +### Hiding nodes and eggs +You can hide specific nodes or eggs from being used by not configuring them in any of your products. This way, they won’t show up in the server creation page and therefore can’t be used by your customers. This is great if you have some nodes or eggs that you want to exclude from Ctrlpanel. + +### Tips +If you have a well-configured product, you can use the Copy button to copy the product to create slight variations of it easily :) diff --git a/versioned_docs/version-0.10/Guides/themes.md b/versioned_docs/version-0.10/Guides/themes.md new file mode 100644 index 0000000..9954536 --- /dev/null +++ b/versioned_docs/version-0.10/Guides/themes.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 4 +--- + +import DocusaurusImageUrl from '@site/static/img/docusaurus.png'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +# Themes + +import TOCInline from '@theme/TOCInline'; + + + +## Install a theme + +:::info +You should always follow the instructions of the theme you want to install. +::: + +Most themes are installed by placing files in the `/themes` and `/public/themes` folders. + +Then you can select the theme in your `settings > system > design` + + +## Create a theme + +### Basic setup +Ctrlpanel.gg uses the module [laravel-themer](https://github.com/qirolab/laravel-themer). +To start creating your own theme run the following command +```sh +php artisan make:theme +``` +This will ask you some basic questions and will setup a base for you to start with. + +### Bladefiles & layout +Now you can find a copy of the original default theme files in the new folder the command above just created. +You should start by modifying those two files first because those are responsible for the main layout of the dashboard. +`/themes//views/layouts/app.blade.php` +`/themes//views/layouts/main.blade.php` + +### CSS +You can create a new folder in `/themes//app.css` with your own custom CSS. +Import the CSS in your blade files with the following line +```blade + +``` +and remove the line +```blade +@vite('themes/default/sass/app.scss') +``` + +### Sharing the theme (Optional) +Make sure you include both the `/themes` and `/public/themes` folder and a file to guide other users on how to install your theme. +Keep the installation instructions as simple as possible and verify you didn´t forget anything, no matter how small the step might seem to you. + +You can upload your theme to our [Market](https://market.ctrlpanel.gg/) or share it however you like. \ No newline at end of file diff --git a/versioned_docs/version-0.10/Guides/translation.md b/versioned_docs/version-0.10/Guides/translation.md new file mode 100644 index 0000000..481a4c3 --- /dev/null +++ b/versioned_docs/version-0.10/Guides/translation.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 3 +--- + +# Adding translation Files + +All translation Files can be found in this repo +https://github.com/1day2die/cpgg_lang + +### How to Install + +Download the needed language.json file and put it in your `/var/www/controlpanel/resources/lang` + +Now you need to enable the Language in your Dashboard Settings. +Go to `YOUR_DASHBOARD.com/admin/settings#language` and adjust your Settings accordingly. +The new Language should pop up in the selection Menu diff --git a/versioned_docs/version-0.10/Guides/uninstallation.md b/versioned_docs/version-0.10/Guides/uninstallation.md new file mode 100644 index 0000000..c6fc186 --- /dev/null +++ b/versioned_docs/version-0.10/Guides/uninstallation.md @@ -0,0 +1,95 @@ +--- +sidebar_position: 5 +--- + +# Uninstallation + +Users, folders and filenames have been renamed from "dashboard" ⇒ "controlpanel". Be aware that the provided commands may not fit your installation. Please change the users, folder and filenames for the commands corresponding to your installation. + +:::warning + +You will loose all data that you have stored in your Ctrlpanel. +Note: This will only work if you followed our documentation, you might need to modify the commands to fit your installation. + +::: + +import TOCInline from '@theme/TOCInline'; + + + +### Stop everything + +You need to stop ctrlpanel and all of its services before you can uninstall it. + +```bash +cd /var/www/controlpanel +sudo php artisan down + +sudo systemctl stop controlpanel +``` +## Remove + +### Service and cronjob + +You have to stop and remove the service and cronjob. + +```bash +sudo systemctl stop controlpanel +sudo systemctl disable controlpanel +sudo rm /etc/systemd/system/controlpanel.service +sudo systemctl daemon-reload +sudo systemctl reset-failed +``` + +To open the crontab run: `crontab -e` and remove the following configuration from crontab. +```bash +* * * * * php /var/www/controlpanel/artisan schedule:run >> /dev/null 2>&1 +``` + +### Webconfig and SSL certificates + +You now have to remove the webconfig and restart it + +```bash +# NGINX +sudo unlink /etc/nginx/sites-enabled/controlpanel.conf +sudo rm /etc/nginx/sites-available/controlpanel.conf +sudo systemctl reload nginx +# Apache2 +sudo a2dissite controlpanel.conf +sudo rm /etc/apache2/sites-available/controlpanel.conf +sudo systemctl reload apache2 + +sudo certbot delete --cert-name +``` + +### Database and User + +You now have to remove the database and user. + +```bash +sudo mysql -u root -p -e "DROP DATABASE controlpanel;" +sudo mysql -u root -p -e "DROP USER 'controlpaneluser'@'127.0.0.1';" +sudo mysql -u root -p -e "FLUSH PRIVILEGES;" +``` + +### Files + +You now have to remove the files. + +```bash +sudo rm -rf /var/www/controlpanel +``` + +### Extra Dependency + +You need to uninstall this, use the appropriate PHP version (php -v) + +```bash +sudo apt remove php8.1-intl +``` + +### Pterodactyl API Key + +Login to your pterodactyl panel and go to the admin page. +Then go to the API tab (`/admin/api`) and delete the key you made for ctrlpanel. diff --git a/versioned_docs/version-0.10/Installation/_category_.json b/versioned_docs/version-0.10/Installation/_category_.json new file mode 100644 index 0000000..e111289 --- /dev/null +++ b/versioned_docs/version-0.10/Installation/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Installation", + "position": 2 +} diff --git a/versioned_docs/version-0.10/Installation/additional-configuration.md b/versioned_docs/version-0.10/Installation/additional-configuration.md new file mode 100644 index 0000000..2d03aad --- /dev/null +++ b/versioned_docs/version-0.10/Installation/additional-configuration.md @@ -0,0 +1,89 @@ +--- +sidebar_position: 3 +--- + +# Additional Configuration + +:::info + +The StripeWebhook URL has been changed in `v0.9` due to the new extension support. Read into Stripe section below, it contains the new URL. + +::: + +import TOCInline from '@theme/TOCInline'; + + + +## Misc Configuration + +### Discord Auth + +Go to `https:///admin/settings#misc` + +**Setting up Auth**
+[How](http://faq.demostoreprestashop.com/faq.php?fid=133&pid=41) to get CLIENT_ID and CLIENT_SECRET
+for the redirect URI, you have to use YOUR_WEBSITE_URL + /auth/callback (example: https://bitsec.dev/auth/callback) + +**Adding the Discord Bot**
+If you would like to automatically force new users to join your Discord server after they have verified, you will need to set up a Discord bot. This can be an already existing Discord bot in your server. + +Add your Discord... + +1. Bot to your server and give him the appropriate permissions. +2. Bot token on the webpage. +3. Guild ID on the webpage. +4. Then press the "Submit" button. + +That's it! The Dashboard can now use your bot to make API calls to Discord to place new users into your Discord server. Your bot will not come online as we only use it to make API calls when someone verifies, you can still use your bot as you normally would :) + +**Custom Role Reward**
+If you would like to give your users a custom role automatically when they verify their Discord account, you have to copy the ID of an existing role from your Discord server and place it on the webpage as well. + +### reCAPTCHA v2 + +Go to `https:///admin/settings#misc` + +Controlpanel uses visible reCAPTCHA to secure the login page from brute-force attacks. If the login attempt is considered suspicious, users may be required to perform a reCAPTCHA challenge. + +You can generate your own keys in the [admin console](https://www.google.com/recaptcha/admin/create) + +To add your keys, you need to add them on the webpage. + +### Manual Mail Configuration + +To send out notifications and mails, you will need to configure your mail variables correctly. +You can use a free mail server; for example, from [Mailjet](https://www.mailjet.com/). You can also install your own mail server using, for example, [mailcow](https://mailcow.email/) + +Go to `https:///admin/settings#misc` and enter your mail credentials. + +Ensure you clear the config cache and restart the queue workers when making changes to the email details.
+`php artisan config:clear` and `php artisan queue:restart` + +To test the mail configuration, you can go to the users tab and click the notify button top right. +Select a user and choose to send via email, write some text and click submit. + +### Payment Configuration + +#### PayPal + +To use the PayPal payment gateway, you have to set up an application at the PayPal developer dashboard `https://developer.paypal.com/developer/accounts/`. + +Go to "My Apps & Credentials" and choose either "Live" for production use or "Sandbox" for testing use of PayPal. + +Create an App, give it any name you want, and copy the Client ID and the Secret into the Settings of ctrlpanel. + +The only "App feature option" that ctrlpanel needs is "Accept Payments". + +#### Stripe + +To use the Stripe payment gateway, you have to create a "company" at the Stripe dashboard and activate it `https://dashboard.stripe.com/account/onboarding/business-structure`. + +Go to the developer page and click on API-Keys. You only need the Secret key in order to use Stripe at your Ctrlpanel. Copy it to the Payment Settings. + +You will need to add a Webhook for Stripe in order to accept payments that are not 100% instantly confirmed by stripe (Klarna, Bank-Transfer etc.). +Click on Webhooks and add an endpoint. +Enter the Endpoint route: `https:///extensions/payment/StripeWebhooks`. +Choose the "payment_intent.succeded" event to be sent to your WebhookRoute. +After the webhook creation, you need to add the endpoint secret (Signing secret) to your Ctrlpanel settings. It can be found at the webhooks overview. + +You can change the mode between Test and Live, just like PayPal. diff --git a/versioned_docs/version-0.10/Installation/getting-started.md b/versioned_docs/version-0.10/Installation/getting-started.md new file mode 100644 index 0000000..425bc13 --- /dev/null +++ b/versioned_docs/version-0.10/Installation/getting-started.md @@ -0,0 +1,258 @@ +--- +sidebar_position: 1 +--- + +# Getting started + +:::info + +It is recommended that you have some sort of Linux and MariaDB experience before installing this. +This guide requires you to already have a working pterodactyl installation. + +::: + +:::warning + +Warning, The dashboard is currently in pre-release and may contain some bugs. Use This dashboard at your own risk. + +::: + +import TOCInline from '@theme/TOCInline'; + + + +## Dependencies + +- PHP `8.1` with the following extensions: `cli`, `openssl`, `gd`, `mysql`, `PDO`, `mbstring`, `tokenizer`, `bcmath`, `xml` or `dom`, `curl`, `zip`, `redis`, and `fpm` if you are planning to use NGINX. +- MySQL `5.7.22` or higher (MySQL `8` recommended) **or** MariaDB `10.2` or higher. +- Redis (`redis-server`) +- A web server (Apache, NGINX, Caddy, etc.) +- `curl` +- `tar` +- `unzip` +- `git` +- `composer` v2 + +### Example Dependency Installation + +_If you already have Pterodactyl installed, please check that you also install PHP 8.1!_ + +The commands below are simply an example of how you might install these dependencies. Please consult with your +operating system's package manager to determine the correct packages to install. + +```bash +# Update repositories list +apt update + +# Add "add-apt-repository" command +apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg + +# Add additional repositories for PHP, Redis, and MariaDB (for Debian 11 and Ubuntu 22.04) +LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php +curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash + +# Add universe repository if you are on Ubuntu 18.04 +apt-add-repository universe + +# Install Dependencies +apt -y install php8.1 php8.1-{cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip,redis} mariadb-server nginx tar unzip git redis-server +``` + +### Extra Dependency Used on this Dashboard + +You need to install this, use the appropriate PHP version (php -v) +Extra dependency used for handling currency's + +```bash +apt -y install php8.1-intl +``` + +### Installing Composer + +_If you already have Pterodactyl installed, you can skip this step!_ + +Composer is a dependency manager for PHP that allows us to ship everything you'll need code wise to operate the Panel. You'll +need composer installed before continuing in this process. + +```bash +curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer +``` + +## Download Files + +The first step in this process is to create the folder where the panel will live and then move ourselves into that +newly created folder. Below is an example of how to perform this operation. + +```bash +mkdir -p /var/www/controlpanel && cd /var/www/controlpanel +``` + +```bash +git clone https://github.com/Ctrlpanel-gg/panel.git ./ +``` + +## Basic Setup + +Now that all the files have been downloaded we need to configure some core aspects of the Panel. + +**You will need a database setup and a database user with the correct permissions created for that database before** +**continuing any further.** + +### Database Setup + +To make a database and database user, you can follow this guide. +This is for MariaDB. Please change the USE_YOUR_OWN_PASSWORD part to your password. Also, 127.0.0.1 is for localhost. Please have basic knowledge of Linux before attempting this. Use at your own responsibility. + +```bash +mysql -u root -p +CREATE DATABASE controlpanel; +CREATE USER 'controlpaneluser'@'127.0.0.1' IDENTIFIED BY 'USE_YOUR_OWN_PASSWORD'; +GRANT ALL PRIVILEGES ON controlpanel.* TO 'controlpaneluser'@'127.0.0.1'; +FLUSH PRIVILEGES; +EXIT; +``` + +## Web server Configuration + +You should paste the contents of the file below, replacing `` with your domain name being used in a file called ctrlpanel.conf and place it in `/etc/nginx/sites-available/`, or — if on CentOS, `/etc/nginx/conf.d/.` + +## How to add this config + +``` +cd /etc/nginx/sites-available/ +nano ctrlpanel.conf +``` + +### Example Nginx Config + +```nginx +server { + listen 80; + root /var/www/controlpanel/public; + index index.php index.html index.htm index.nginx-debian.html; + server_name YOUR.DOMAIN.COM; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; + } + + location ~ /\.ht { + deny all; + } +} +``` + +### Enable Configuration + +The final step is to enable your NGINX configuration and restart it. + +```bash +# You do not need to symlink this file if you are using CentOS. +sudo ln -s /etc/nginx/sites-available/ctrlpanel.conf /etc/nginx/sites-enabled/ctrlpanel.conf + +# Check for nginx errors +sudo nginx -t + +# You need to restart nginx regardless of OS. only do this you haven't received any errors +systemctl restart nginx +``` + +### Adding SSL + +There are many ways to add SSL to your site. A simple solution is to use Cert bot from Let’s Encrypt. Cert bot will automatically install the certificates for you and keep your SSL certifications up to date! + +```bash +sudo apt update +#install certbot for nginx +sudo apt install -y certbot +sudo apt install -y python3-certbot-nginx +#install certificates +sudo certbot --nginx -d yourdomain.com +``` + +## Panel Installation + +First, we will have to install all composer packages. +For this, navigate into your `/var/www/controlpanel` again and run the following command + +```bash +composer install --no-dev --optimize-autoloader +``` + +### Set Permissions + +The last step in the installation process is to set the correct permissions on the Panel files so that the web server can +use them correctly. + +```bash +# If using NGINX or Apache (not on CentOS): +chown -R www-data:www-data /var/www/controlpanel/ +chmod -R 755 storage/* bootstrap/cache/ + +# If using NGINX on CentOS: +chown -R nginx:nginx /var/www/controlpanel/ +chmod -R 755 storage/* bootstrap/cache/ + +# If using Apache on CentOS +chown -R apache:apache /var/www/controlpanel/ +chmod -R 755 storage/* bootstrap/cache/ + +**** +``` + +Once this is done, you should be able to access the dashboard via your web browser. + +### Running the installer + +#### Navigate to `https://yourdomain.com/install` to run the Web-Installer and follow the steps. + +If you encounter problems with the email setup, you can use the skip button and set it up later. + +Once the Web-Installer has been completed, you will be navigated to the login-page of your installation.
+#### Don't forget to complete the steps listed below here. + +## Queue Listeners + +### Crontab Configuration + +The first thing we need to do is create a new cron job that runs every minute to process specific Dashboard tasks such as billing users hourly and suspending unpaid servers. To open the crontab run: `crontab -e` and paste the following configuration into crontab. + +```bash +* * * * * php /var/www/controlpanel/artisan schedule:run >> /dev/null 2>&1 +``` + +### Create Queue Worker + +Next, you need to create a new systemd worker to keep our queue process running in the background. This queue is responsible for sending emails and handling many other background tasks for the Dashboard. + +Create a file called `ctrlpanel.service` in `/etc/systemd/system` with the contents below. + +```bash +# Ctrlpanel Queue Worker File +# ---------------------------------- + +[Unit] +Description=Ctrlpanel Queue Worker + +[Service] +# On some systems the user and group might be different. +# Some systems use `apache` or `nginx` as the user and group. +User=www-data +Group=www-data +Restart=always +ExecStart=/usr/bin/php /var/www/controlpanel/artisan queue:work --sleep=3 --tries=3 + +[Install] +WantedBy=multi-user.target +``` + +Finally, enable the service and set it to boot on machine start. + +```bash +sudo systemctl enable --now ctrlpanel.service +``` diff --git a/versioned_docs/version-0.10/Installation/troubleshooting.md b/versioned_docs/version-0.10/Installation/troubleshooting.md new file mode 100644 index 0000000..be48187 --- /dev/null +++ b/versioned_docs/version-0.10/Installation/troubleshooting.md @@ -0,0 +1,23 @@ +--- +sidebar_position: 4 +--- + +# Troubleshooting + +## Getting Error Logs + +### Text Output + +The following command will grab the last 100 lines of logs from the dashboard, and it will output it into the console. + +``` +tail -n 100 /var/www/controlpanel/storage/logs/laravel.log +``` + +### Hastebin Output + +The following command will grab the last 100 lines of logs from the dashboard and output the link to a hastebin that it pasted it into. Hint: You can change the hastebin link. + +``` +tail -n 100 /var/www/controlpanel/storage/logs/laravel.log | nc pteropaste.com 99 +``` diff --git a/versioned_docs/version-0.10/Installation/updating.md b/versioned_docs/version-0.10/Installation/updating.md new file mode 100644 index 0000000..eb58169 --- /dev/null +++ b/versioned_docs/version-0.10/Installation/updating.md @@ -0,0 +1,78 @@ +--- +sidebar_position: 5 +--- + +# Updating + +:::caution +This guide is for updates 0.9.0 -> 0.9.X +If you update from 0.8.X or older, please follow our 0.9 update guide. (Version dropdown top right) +::: + +### Enable Maintenance Mode + +```bash +cd /var/www/controlpanel +sudo php artisan down +``` + +### Pulling the New Files + +```bash +sudo git stash +sudo git pull +sudo chmod -R 755 /var/www/controlpanel +``` + +### Update Dependencies + +```bash +sudo composer install --no-dev --optimize-autoloader +``` + +### Updating the Database + +```bash +sudo php artisan migrate --seed --force +``` + +### Clear Compiled Template Cache + +```bash +sudo php artisan view:clear +sudo php artisan config:clear +``` + +### Set Permissions + +```bash +# If using NGINX or Apache (not on CentOS): +sudo chown -R www-data:www-data /var/www/controlpanel/ + +# If using NGINX on CentOS: +sudo chown -R nginx:nginx /var/www/controlpanel/ + +# If using Apache on CentOS +sudo chown -R apache:apache /var/www/controlpanel/ +``` + +### Restarting Queue Workers + +After every update, you should restart the queue worker to ensure that the new code is loaded in and used. + +```bash +sudo php artisan queue:restart +``` + +### Disable Maintenance Mode + +```bash +sudo php artisan up +``` + +## Disclaimer + +Warning, The dashboard is currently in pre-release and may contain some bugs 🐛
+Use This dashboard at your own risk. + +If you notice any bugs or would like something to be improved or added, let us know by making a [GitHub Issue](https://github.com/ControlPanel-gg/dashboard/issues/new/choose)
**for any major security risk, contact** _1Day2Die#6718_ diff --git a/versioned_docs/version-0.10/intro.md b/versioned_docs/version-0.10/intro.md new file mode 100644 index 0000000..de2dc53 --- /dev/null +++ b/versioned_docs/version-0.10/intro.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 1 +--- + +# Introduction + +ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their [Pterodactyl](https://pterodactyl.io/) servers. This dashboard comes with a credit-based billing solution that credits users hourly for each server they have and suspends servers if they run out of credits. + +This dashboard offers an easy to use and free billing solution for all starting and experienced hosting providers. This dashboard has many customization options and added Discord OAuth verification to offer a solid link between your Discord server and your dashboard. + +## Installation +You can find our guide for installation [here](Installation/getting-started). + +## Third-parties +You can find custom themes and programs from our [Extension Hub](https://market.ctrlpanel.gg/) those are developed by third-parties. + +## Support +Have a few questions? Feel free to [join](https://discord.gg/GY7PWejUaG) our support Discord server. + +We also announce every single release in our Discord and we would love to hear your feedback! diff --git a/versioned_docs/version-0.8/intro.md b/versioned_docs/version-0.8/intro.md index 46a6e72..de2dc53 100644 --- a/versioned_docs/version-0.8/intro.md +++ b/versioned_docs/version-0.8/intro.md @@ -12,7 +12,7 @@ This dashboard offers an easy to use and free billing solution for all starting You can find our guide for installation [here](Installation/getting-started). ## Third-parties -You can find custom themes and programs from our [Extension Hub](https://market.controlpanel.gg/) those are developed by third-parties. +You can find custom themes and programs from our [Extension Hub](https://market.ctrlpanel.gg/) those are developed by third-parties. ## Support Have a few questions? Feel free to [join](https://discord.gg/GY7PWejUaG) our support Discord server. diff --git a/versioned_docs/version-0.9.1/Guides/themes.md b/versioned_docs/version-0.9.1/Guides/themes.md new file mode 100644 index 0000000..9954536 --- /dev/null +++ b/versioned_docs/version-0.9.1/Guides/themes.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 4 +--- + +import DocusaurusImageUrl from '@site/static/img/docusaurus.png'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +# Themes + +import TOCInline from '@theme/TOCInline'; + + + +## Install a theme + +:::info +You should always follow the instructions of the theme you want to install. +::: + +Most themes are installed by placing files in the `/themes` and `/public/themes` folders. + +Then you can select the theme in your `settings > system > design` + + +## Create a theme + +### Basic setup +Ctrlpanel.gg uses the module [laravel-themer](https://github.com/qirolab/laravel-themer). +To start creating your own theme run the following command +```sh +php artisan make:theme +``` +This will ask you some basic questions and will setup a base for you to start with. + +### Bladefiles & layout +Now you can find a copy of the original default theme files in the new folder the command above just created. +You should start by modifying those two files first because those are responsible for the main layout of the dashboard. +`/themes//views/layouts/app.blade.php` +`/themes//views/layouts/main.blade.php` + +### CSS +You can create a new folder in `/themes//app.css` with your own custom CSS. +Import the CSS in your blade files with the following line +```blade + +``` +and remove the line +```blade +@vite('themes/default/sass/app.scss') +``` + +### Sharing the theme (Optional) +Make sure you include both the `/themes` and `/public/themes` folder and a file to guide other users on how to install your theme. +Keep the installation instructions as simple as possible and verify you didn´t forget anything, no matter how small the step might seem to you. + +You can upload your theme to our [Market](https://market.ctrlpanel.gg/) or share it however you like. \ No newline at end of file diff --git a/versioned_docs/version-0.9.1/Guides/uninstallation.md b/versioned_docs/version-0.9.1/Guides/uninstallation.md index e104d62..c6fc186 100644 --- a/versioned_docs/version-0.9.1/Guides/uninstallation.md +++ b/versioned_docs/version-0.9.1/Guides/uninstallation.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 --- # Uninstallation diff --git a/versioned_docs/version-0.9.1/Installation/getting-started.md b/versioned_docs/version-0.9.1/Installation/getting-started.md index 2886cb1..d05d8f1 100644 --- a/versioned_docs/version-0.9.1/Installation/getting-started.md +++ b/versioned_docs/version-0.9.1/Installation/getting-started.md @@ -7,6 +7,7 @@ sidebar_position: 1 :::info It is recommended that you have some sort of Linux and MariaDB experience before installing this. +This guide requires you to already have a working pterodactyl installation. ::: diff --git a/versioned_docs/version-0.9.1/intro.md b/versioned_docs/version-0.9.1/intro.md index 46a6e72..de2dc53 100644 --- a/versioned_docs/version-0.9.1/intro.md +++ b/versioned_docs/version-0.9.1/intro.md @@ -12,7 +12,7 @@ This dashboard offers an easy to use and free billing solution for all starting You can find our guide for installation [here](Installation/getting-started). ## Third-parties -You can find custom themes and programs from our [Extension Hub](https://market.controlpanel.gg/) those are developed by third-parties. +You can find custom themes and programs from our [Extension Hub](https://market.ctrlpanel.gg/) those are developed by third-parties. ## Support Have a few questions? Feel free to [join](https://discord.gg/GY7PWejUaG) our support Discord server. diff --git a/versioned_docs/version-0.9/Guides/themes.md b/versioned_docs/version-0.9/Guides/themes.md new file mode 100644 index 0000000..9954536 --- /dev/null +++ b/versioned_docs/version-0.9/Guides/themes.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 4 +--- + +import DocusaurusImageUrl from '@site/static/img/docusaurus.png'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +# Themes + +import TOCInline from '@theme/TOCInline'; + + + +## Install a theme + +:::info +You should always follow the instructions of the theme you want to install. +::: + +Most themes are installed by placing files in the `/themes` and `/public/themes` folders. + +Then you can select the theme in your `settings > system > design` + + +## Create a theme + +### Basic setup +Ctrlpanel.gg uses the module [laravel-themer](https://github.com/qirolab/laravel-themer). +To start creating your own theme run the following command +```sh +php artisan make:theme +``` +This will ask you some basic questions and will setup a base for you to start with. + +### Bladefiles & layout +Now you can find a copy of the original default theme files in the new folder the command above just created. +You should start by modifying those two files first because those are responsible for the main layout of the dashboard. +`/themes//views/layouts/app.blade.php` +`/themes//views/layouts/main.blade.php` + +### CSS +You can create a new folder in `/themes//app.css` with your own custom CSS. +Import the CSS in your blade files with the following line +```blade + +``` +and remove the line +```blade +@vite('themes/default/sass/app.scss') +``` + +### Sharing the theme (Optional) +Make sure you include both the `/themes` and `/public/themes` folder and a file to guide other users on how to install your theme. +Keep the installation instructions as simple as possible and verify you didn´t forget anything, no matter how small the step might seem to you. + +You can upload your theme to our [Market](https://market.ctrlpanel.gg/) or share it however you like. \ No newline at end of file diff --git a/versioned_docs/version-0.9/Guides/uninstallation.md b/versioned_docs/version-0.9/Guides/uninstallation.md index cde1046..053f9f5 100644 --- a/versioned_docs/version-0.9/Guides/uninstallation.md +++ b/versioned_docs/version-0.9/Guides/uninstallation.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 --- # Uninstallation diff --git a/versioned_docs/version-0.9/intro.md b/versioned_docs/version-0.9/intro.md index 46a6e72..de2dc53 100644 --- a/versioned_docs/version-0.9/intro.md +++ b/versioned_docs/version-0.9/intro.md @@ -12,7 +12,7 @@ This dashboard offers an easy to use and free billing solution for all starting You can find our guide for installation [here](Installation/getting-started). ## Third-parties -You can find custom themes and programs from our [Extension Hub](https://market.controlpanel.gg/) those are developed by third-parties. +You can find custom themes and programs from our [Extension Hub](https://market.ctrlpanel.gg/) those are developed by third-parties. ## Support Have a few questions? Feel free to [join](https://discord.gg/GY7PWejUaG) our support Discord server. diff --git a/versioned_sidebars/version-0.10-sidebars.json b/versioned_sidebars/version-0.10-sidebars.json new file mode 100644 index 0000000..593036a --- /dev/null +++ b/versioned_sidebars/version-0.10-sidebars.json @@ -0,0 +1,8 @@ +{ + "version-0.10/tutorialSidebar": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/versions.json b/versions.json index 58a47d0..0de1bbe 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ [ - "0.9.1","0.9","0.8" + "0.10","0.9.1","0.9","0.8" ]