mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-30 15:30:51 -05:00
update: use sentence case for headings in docs
Sentence case is more standard these days than title case: https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Section_headings.
This commit is contained in:
+34
-34
@@ -6,20 +6,20 @@ UNIT3D offers built in backup tools, available through the web dashboard or via
|
||||
|
||||
**Customize** `config/backup.php` in your editor and adjust settings as needed; inline notes outline the available configuration parameters.
|
||||
|
||||
**Key structure**:
|
||||
**Key structure**:
|
||||
|
||||
- **`backup`**
|
||||
- **`backup`**
|
||||
|
||||
- **`name`**
|
||||
- **`name`**
|
||||
|
||||
- **`source`**
|
||||
- **`files`**
|
||||
- **`source`**
|
||||
- **`files`**
|
||||
|
||||
Specifies which directories and files to `include` and which to `exclude` in the backup.
|
||||
|
||||
```php
|
||||
'include' => [
|
||||
base_path(),
|
||||
base_path(),
|
||||
],
|
||||
|
||||
'exclude' => [
|
||||
@@ -27,47 +27,47 @@ UNIT3D offers built in backup tools, available through the web dashboard or via
|
||||
base_path('vendor'),
|
||||
base_path('node_modules'),
|
||||
base_path('storage'),
|
||||
base_path('public/vendor/joypixels'),
|
||||
base_path('public/vendor/joypixels'),
|
||||
],
|
||||
```
|
||||
```
|
||||
|
||||
- **`follow_links`**
|
||||
- **`follow_links`**
|
||||
|
||||
- **`ignore_unreadable_directories`**
|
||||
- **`ignore_unreadable_directories`**
|
||||
|
||||
- **`relative_path`**
|
||||
- **`relative_path`**
|
||||
|
||||
- **`databases`**
|
||||
- **`databases`**
|
||||
|
||||
Specifies the database connections to back up.
|
||||
|
||||
- **`database_dump_compressor`**
|
||||
- **`database_dump_compressor`**
|
||||
|
||||
Compressor class (e.g. `Spatie\DbDumper\Compressors\GzipCompressor::class`) or `null` to disable.
|
||||
|
||||
- **`destination`**
|
||||
- **`destination`**
|
||||
|
||||
Defines the storage location for backup files.
|
||||
|
||||
- **`temporary_directory`**
|
||||
- **`temporary_directory`**
|
||||
|
||||
Staging directory for temporary files.
|
||||
|
||||
- **`notifications`**
|
||||
- **`notifications`**
|
||||
|
||||
Define when and how backup events trigger alerts via mail, Slack, or custom channels.
|
||||
Define when and how backup events trigger alerts via mail, Slack, or custom channels.
|
||||
|
||||
- **`monitor_backups`**
|
||||
- **`monitor_backups`**
|
||||
|
||||
Detect backup issues; triggers `UnhealthyBackupWasFound` when needed.
|
||||
Detect backup issues; triggers `UnhealthyBackupWasFound` when needed.
|
||||
|
||||
- **`cleanup`**
|
||||
- **`cleanup`**
|
||||
|
||||
Define how long to keep backups and when to purge old archives.
|
||||
Define how long to keep backups and when to purge old archives.
|
||||
|
||||
- **`strategy`**
|
||||
- **`strategy`**
|
||||
|
||||
- **`default_strategy`**
|
||||
- **`default_strategy`**
|
||||
|
||||
Keeps all backups for 7 days; then retains daily backups for 16 days, weekly for 8 weeks, monthly for 4 months, and yearly for 2 years. Deletes old backups exceeding 5000 MB.
|
||||
|
||||
@@ -80,23 +80,23 @@ UNIT3D offers built in backup tools, available through the web dashboard or via
|
||||
'delete_oldest_backups_when_using_more_megabytes_than' => 5000,
|
||||
```
|
||||
|
||||
- **`security`**
|
||||
- **`security`**
|
||||
|
||||
Ensure that only someone with your `APP_KEY` can decrypt and restore snapshots.
|
||||
|
||||
## 2. Create a Backup
|
||||
## 2. Create a backup
|
||||
|
||||
You can access the built-in Backups dashboard from the Staff menu. It shows each backup’s status, health, size, and count, and lets administrators launch unscheduled full, database, or files-only backups instantly. Another approach is to use the command line.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Backups initiated via the Staff Dashboard buttons may timeout on very large installations.
|
||||
> [!IMPORTANT]
|
||||
> Backups initiated via the Staff Dashboard buttons may timeout on very large installations.
|
||||
|
||||
- The following artisan commands are available:
|
||||
- The following artisan commands are available:
|
||||
|
||||
```sh
|
||||
php artisan backup:run
|
||||
```
|
||||
|
||||
|
||||
Creates a timestamped ZIP of application files and database.
|
||||
|
||||
```sh
|
||||
@@ -112,7 +112,7 @@ You can access the built-in Backups dashboard from the Staff menu. It shows each
|
||||
Creates a timestamped ZIP containing only application files.
|
||||
|
||||
|
||||
## 3. Viewing Backup List
|
||||
## 3. Viewing backup list
|
||||
|
||||
- **List** existing backups:
|
||||
|
||||
@@ -121,10 +121,10 @@ You can access the built-in Backups dashboard from the Staff menu. It shows each
|
||||
```
|
||||
|
||||
|
||||
## 4. Restoring a Backup
|
||||
## 4. Restoring a backup
|
||||
|
||||
> [!WARNING]
|
||||
> **Always test backup restoration procedures on a non‑critical environment before applying to production.**
|
||||
> [!WARNING]
|
||||
> **Always test backup restoration procedures on a non‑critical environment before applying to production.**
|
||||
> Incorrect restoration can lead to data loss or service disruption.
|
||||
|
||||
1. **Install prerequisites** (Debian/Ubuntu):
|
||||
@@ -181,7 +181,7 @@ You can access the built-in Backups dashboard from the Staff menu. It shows each
|
||||
2. **Restore** your database:
|
||||
|
||||
```sh
|
||||
mysql -u unit3d -p unit3d < ~/tempBackup/db-dumps/mysql-unit3d.sql
|
||||
mysql -u unit3d -p unit3d < ~/tempBackup/db-dumps/mysql-unit3d.sql
|
||||
```
|
||||
|
||||
## 5. Reset & Cleanup
|
||||
|
||||
+12
-12
@@ -1,11 +1,11 @@
|
||||
# Basic Tuning
|
||||
# Basic tuning
|
||||
|
||||
<!-- cspell:ignore unixsocket,unixsocketperm,usermod,ondemand,curlopt,cainfo -->
|
||||
|
||||
> [!IMPORTANT]
|
||||
> These guides are intended for UNIT3D v8.0.0 + instances. While these are better than defaults be careful blindly following them. Proper tuning requires understanding your server, running tests and monitoring the results.
|
||||
|
||||
## Redis Single Server
|
||||
## Redis single server
|
||||
|
||||
| Category | Severity | Time To Fix |
|
||||
| ------------- |:----------:| ------------:|
|
||||
@@ -19,7 +19,7 @@ Based on the Redis official benchmark, you can **improve performance by up to 50
|
||||
|
||||
Of course, unix sockets can only be used if both your Laravel application and Redis are running on the same server.
|
||||
|
||||
### How To Enable Unix Sockets
|
||||
### How to enable unix sockets
|
||||
|
||||
First, create the redis folder that the unix socket will be in and set appropriate permissions:
|
||||
|
||||
@@ -88,7 +88,7 @@ sudo systemctl restart redis
|
||||
> Keep in mind that when using unix socket you will now connect to redis-cli in terminal like so: `redis-cli -s /var/run/redis/redis.sock`
|
||||
|
||||
|
||||
## MySQL Single Server
|
||||
## MySQL single server
|
||||
|
||||
| Category | Severity | Time To Fix |
|
||||
| ------------- |:----------:| ------------:|
|
||||
@@ -102,7 +102,7 @@ Based on Percona's benchmark, you can **improve performance by up to 50%** using
|
||||
|
||||
Of course, unix sockets can only be used if both your UNIT3D application and database are running on the same server which is by default.
|
||||
|
||||
### How To Enable Unix Sockets
|
||||
### How to enable unix sockets
|
||||
|
||||
First, open your MySQL configuration file.
|
||||
|
||||
@@ -158,7 +158,7 @@ sudo systemctl restart mysql && sudo systemctl restart php8.3-fpm && sudo system
|
||||
- [MySQL Unix Socket Setup](https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-socket-errors-in-mysql)
|
||||
- [MySQL Shell Connections Guide](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-connection-socket.html)
|
||||
|
||||
## Composer Autoloader Optimization
|
||||
## Composer autoloader optimization
|
||||
|
||||
| Category | Severity | Time To Fix |
|
||||
| ------------- |:----------:| ------------:|
|
||||
@@ -170,7 +170,7 @@ Due to the way PSR-0/4 autoloading rules are defined, the Composer autoloader ch
|
||||
|
||||
In production, Composer allows for optimization to convert the PSR-0 and PSR-4 autoloading rules into classmap rules, making autoloading quite a bit faster. In production we also don't need all the require-dev dependencies loaded up!
|
||||
|
||||
### How To Optimize?
|
||||
### How to optimize?
|
||||
It's really simple. SSH to your server and run the following commands.
|
||||
```bash
|
||||
composer install --prefer-dist --no-dev
|
||||
@@ -225,7 +225,7 @@ And there you have it folks. Experiment with these values, depending on the reso
|
||||
|
||||
Enjoy! 🖖
|
||||
|
||||
## PHP 8 Preloading
|
||||
## PHP 8 preloading
|
||||
|
||||
| Category | Severity | Time To Fix |
|
||||
| ------------- |:----------:| ------------:|
|
||||
@@ -238,7 +238,7 @@ This is chaining off `Want More Performance? Lets talk about OPCache!` guide. Yo
|
||||
|
||||
PHP preloading for PHP >=7.4. Preloading is a feature of php that will pre-compile php functions and classes to opcache. Thus, this becomes available in your programs with out needing to require the files, which improves speed. To read more on php preloading you can see the [opcache.preloading documentation](https://www.php.net/manual/en/opcache.preloading.php).
|
||||
|
||||
### Enabling Preloading
|
||||
### Enabling preloading
|
||||
|
||||
SSH to your server and run the following command. `sudo nano /etc/php/8.3/fpm/php.ini` This is assuming your on PHP 8.3. If not then adjust the command. Once you have the config open search for `preload`.
|
||||
|
||||
@@ -273,7 +273,7 @@ PHP 8 adds a JIT compiler to PHP's core which has the potential to speed up perf
|
||||
|
||||
First of all, the JIT will only work if opcache is enabled, this is the default for most PHP installations, but you should make sure that `opcache.enable` is set to `1` in your php.ini file. Enabling the JIT itself is done by specifying `opcache.jit_buffer_size` in php.ini. **_So I recommend checking the OPcache guide I made first then coming back here._**
|
||||
|
||||
### How To Enable JIT
|
||||
### How to enable JIT
|
||||
SSH to your server and run the following command. `sudo nano /etc/php/8.3/fpm/php.ini` This is assuming your on PHP 8.2. If not then adjust the command. Once you have the config open search for `opcache.jit`.
|
||||
|
||||
If you do not get any results then search for `[curl]` you should see the following.
|
||||
@@ -293,7 +293,7 @@ opcache.jit_buffer_size=256M
|
||||
|
||||
Its as simple as that. Save and exit and restart PHP. `sudo systemctl restart php8.2-fpm`
|
||||
|
||||
## PM Static
|
||||
## PM static
|
||||
|
||||
| Category | Severity | Time To Fix |
|
||||
| ------------- |:----------:| ------------:|
|
||||
@@ -314,7 +314,7 @@ Lets give a basic description on what these options are:
|
||||
|
||||
The PHP-FPM pm static setting depends heavily on how much free memory your server has. Basically if you are suffering from low server memory, then pm ondemand or dynamic maybe be better options. On the other hand, if you have the memory available you can avoid much of the PHP process manager (PM) overhead by setting pm static to the max capacity of your server. In other words, when you do the math, pm.static should be set to the max amount of PHP-FPM processes that can run without creating memory availability or cache pressure issues. Also, not so high as to overwhelm CPU(s) and have a pile of pending PHP-FPM operations.
|
||||
|
||||
### Enabling Static
|
||||
### Enabling static
|
||||
|
||||
Lets open up our PHP configuration file. `sudo nano /etc/php/8.3/fpm/pool.d/www.conf`
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ This guide outlines the steps to set up UNIT3D using Laravel Sail on Arch Linux.
|
||||
> [!IMPORTANT]
|
||||
> This guide is intended for local development environments only and is not suitable for production deployment.
|
||||
|
||||
## Modifying `.env` and Secure Headers for Non-HTTPS Instances
|
||||
## Modifying `.env` and secure headers for non-HTTPS instances
|
||||
|
||||
For local development, HTTP is commonly used instead of HTTPS. To prevent mixed content issues, adjust your `.env` file as follows:
|
||||
|
||||
@@ -38,7 +38,7 @@ Refer to the [Arch Linux Docker documentation](https://wiki.archlinux.org/title/
|
||||
sudo pacman -S docker docker-compose
|
||||
```
|
||||
|
||||
## Step 1: Clone the Repository
|
||||
## Step 1: clone the repository
|
||||
|
||||
Clone the UNIT3D repository to your local environment:
|
||||
|
||||
@@ -54,7 +54,7 @@ Clone the UNIT3D repository to your local environment:
|
||||
git clone git@github.com:HDInnovations/UNIT3D-Community-Edition.git
|
||||
```
|
||||
|
||||
## Step 2: Composer Dependency Installation
|
||||
## Step 2: Composer dependency installation
|
||||
|
||||
1. **Change to the project’s root directory:**
|
||||
|
||||
@@ -70,9 +70,9 @@ Clone the UNIT3D repository to your local environment:
|
||||
composer install
|
||||
```
|
||||
|
||||
## Step 3: Docker Environment Initialization
|
||||
## Step 3: Docker environment initialization
|
||||
|
||||
1. **Switch to Branch 8.x.x:**
|
||||
1. **Switch to branch 8.x.x:**
|
||||
|
||||
Before starting Docker, switch to the `8.x.x` branch:
|
||||
|
||||
@@ -86,7 +86,7 @@ Clone the UNIT3D repository to your local environment:
|
||||
./vendor/bin/sail up -d
|
||||
```
|
||||
|
||||
## Step 4: App Key Generation
|
||||
## Step 4: app key generation
|
||||
|
||||
Generate a new `APP_KEY` in the `.env` file for encryption:
|
||||
|
||||
@@ -96,7 +96,7 @@ Generate a new `APP_KEY` in the `.env` file for encryption:
|
||||
|
||||
**Note**: If you are importing a database backup, make sure to set the `APP_KEY` in the `.env` file to match the key used when the backup was created.
|
||||
|
||||
## Step 5: Database Migrations and Seeders
|
||||
## Step 5: database migrations and seeders
|
||||
|
||||
Initialize your database with sample data by running migrations and seeders:
|
||||
|
||||
@@ -107,13 +107,13 @@ Initialize your database with sample data by running migrations and seeders:
|
||||
> [!IMPORTANT]
|
||||
> This operation resets your database and seeds it with default data. Avoid running this in a production environment.
|
||||
|
||||
## Step 6: Database Preparation
|
||||
## Step 6: database preparation
|
||||
|
||||
### Initial Database Loading
|
||||
### Initial database loading
|
||||
|
||||
Prepare your database with the initial schema and data. Make sure you have a database dump file, such as `prod-site-backup.sql`.
|
||||
|
||||
### MySQL Data Importation
|
||||
### MySQL data importation
|
||||
|
||||
Import your database dump into MySQL within the Docker environment:
|
||||
|
||||
@@ -123,7 +123,7 @@ Import your database dump into MySQL within the Docker environment:
|
||||
|
||||
**Note**: Ensure that the `APP_KEY` in the `.env` file matches the key used in your deployment environment for compatibility.
|
||||
|
||||
## Step 7: NPM Dependency Management
|
||||
## Step 7: NPM dependency management
|
||||
|
||||
Manage Node.js dependencies and compile assets within the Docker environment:
|
||||
|
||||
@@ -138,7 +138,7 @@ If needed, refresh the Node.js environment:
|
||||
./vendor/bin/sail rm -rf node_modules && bun pm cache rm && bun install && bun run build
|
||||
```
|
||||
|
||||
## Step 8: Application Cache Configuration
|
||||
## Step 8: application cache configuration
|
||||
|
||||
Optimize the application's performance by setting up the cache:
|
||||
|
||||
@@ -146,7 +146,7 @@ Optimize the application's performance by setting up the cache:
|
||||
./vendor/bin/sail artisan set:all_cache
|
||||
```
|
||||
|
||||
## Step 9: Environment Restart
|
||||
## Step 9: environment restart
|
||||
|
||||
Apply new configurations or restart the environment by toggling the Docker environment:
|
||||
|
||||
@@ -154,43 +154,43 @@ Apply new configurations or restart the environment by toggling the Docker envir
|
||||
./vendor/bin/sail restart && ./vendor/bin/sail artisan queue:restart
|
||||
```
|
||||
|
||||
## Additional Notes
|
||||
## Additional notes
|
||||
|
||||
- **Permissions**: Use `sudo` cautiously to avoid permission conflicts, particularly with Docker commands that require elevated access.
|
||||
|
||||
### Appendix: Sail Commands for UNIT3D
|
||||
### Appendix: Sail commands for UNIT3D
|
||||
|
||||
This section provides a reference for managing and interacting with UNIT3D using Laravel Sail.
|
||||
|
||||
#### Docker Management
|
||||
#### Docker management
|
||||
|
||||
- **Start Environment**:
|
||||
- **Start environment**:
|
||||
```bash
|
||||
./vendor/bin/sail up -d
|
||||
```
|
||||
Starts Docker containers in detached mode.
|
||||
|
||||
- **Stop Environment**:
|
||||
- **Stop environment**:
|
||||
```bash
|
||||
./vendor/bin/sail down
|
||||
```
|
||||
Stops and removes Docker containers.
|
||||
|
||||
- **Restart Environment**:
|
||||
- **Restart environment**:
|
||||
```bash
|
||||
./vendor/bin/sail restart
|
||||
```
|
||||
Applies changes by restarting the Docker environment.
|
||||
|
||||
#### Dependency Management
|
||||
#### Dependency management
|
||||
|
||||
- **Install Composer Dependencies**:
|
||||
- **Install Composer dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail composer install
|
||||
```
|
||||
Installs PHP dependencies defined in `composer.json`.
|
||||
|
||||
- **Update Composer Dependencies**:
|
||||
- **Update Composer dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail composer update
|
||||
```
|
||||
@@ -198,55 +198,55 @@ This section provides a reference for managing and interacting with UNIT3D using
|
||||
|
||||
#### Laravel Artisan
|
||||
|
||||
- **Run Migrations**:
|
||||
- **Run migrations**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan migrate
|
||||
```
|
||||
Executes database migrations.
|
||||
|
||||
- **Seed Database**:
|
||||
- **Seed database**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan db:seed
|
||||
```
|
||||
Seeds the database with predefined data.
|
||||
|
||||
- **Refresh Database**:
|
||||
- **Refresh database**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan migrate:fresh --seed
|
||||
```
|
||||
Resets and seeds the database.
|
||||
|
||||
- **Cache Configurations**:
|
||||
- **Cache configurations**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan set:all_cache
|
||||
```
|
||||
Clears and caches configurations for performance.
|
||||
|
||||
#### NPM and Assets
|
||||
#### NPM and assets
|
||||
|
||||
- **Install NPM Dependencies**:
|
||||
- **Install NPM dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail bun install
|
||||
```
|
||||
Installs Node.js dependencies.
|
||||
|
||||
- **Compile Assets**:
|
||||
- **Compile assets**:
|
||||
```bash
|
||||
./vendor/bin/sail bun run build
|
||||
```
|
||||
Compiles CSS and JavaScript assets.
|
||||
|
||||
#### Database Operations
|
||||
#### Database operations
|
||||
|
||||
- **MySQL Interaction**:
|
||||
- **MySQL interaction**:
|
||||
```bash
|
||||
./vendor/bin/sail mysql -u root -p
|
||||
```
|
||||
Opens MySQL CLI for database interaction.
|
||||
|
||||
#### Queue Management
|
||||
#### Queue management
|
||||
|
||||
- **Restart Queue Workers**:
|
||||
- **Restart queue workers**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan queue:restart
|
||||
```
|
||||
@@ -254,13 +254,13 @@ This section provides a reference for managing and interacting with UNIT3D using
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
- **View Logs**:
|
||||
- **View logs**:
|
||||
```bash
|
||||
./vendor/bin/sail logs
|
||||
```
|
||||
Displays Docker container logs.
|
||||
|
||||
- **Run PHPUnit (PEST) Tests**:
|
||||
- **Run PHPUnit (PEST) tests**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan test
|
||||
```
|
||||
|
||||
@@ -7,11 +7,11 @@ This guide is designed for setting up UNIT3D, a Laravel application, leveraging
|
||||
**Warning**: This setup guide is intended for local development environments only and is not suitable for production
|
||||
deployment.
|
||||
|
||||
## Modifying .env and Secure Headers for Non-HTTPS Instances
|
||||
## Modifying .env and secure headers for non-HTTPS instances
|
||||
|
||||
For local development, it's common to use HTTP instead of HTTPS. To prevent mixed content issues, follow these steps:
|
||||
|
||||
1. **Modify the `.env` Config:**
|
||||
1. **Modify the `.env` config:**
|
||||
- Open your `.env` file located in the root directory of your UNIT3D project.
|
||||
- Find the `SESSION_SECURE_COOKIE` setting and change its value to `false`. This action disables secure cookies,
|
||||
which are otherwise required for HTTPS.
|
||||
@@ -20,7 +20,7 @@ For local development, it's common to use HTTP instead of HTTPS. To prevent mixe
|
||||
SESSION_SECURE_COOKIE=false
|
||||
```
|
||||
|
||||
2. **Adjust the Secure Headers in `config/secure-headers.php`:**
|
||||
2. **Adjust the secure headers in `config/secure-headers.php`:**
|
||||
- Navigate to the `config` directory and open the `secure-headers.php` file.
|
||||
- To disable the `Strict-Transport-Security` header, locate the `hsts` setting and change its value to `false`.
|
||||
|
||||
@@ -55,30 +55,30 @@ Once installed, launch GitHub Desktop
|
||||
|
||||
Once installed, launch PHPStorm
|
||||
|
||||
## Step 1: Clone the Repository
|
||||
## Step 1: clone the repository
|
||||
|
||||
Firstly, clone the UNIT3D repository to your local environment by visiting [UNIT3D-Community-Edition Repo](https://github.com/HDInnovations/UNIT3D-Community-Edition). Then click the blue colored code button and select `Open with Github Desktop`. Once Github Desktop is open set you local path to clone to like `/Users/HDVinnie/Documents/Personal/UNIT3D-Community-Edition`
|
||||
|
||||
## Step 2: Open The Project In PHPStorm
|
||||
## Step 2: open the project in PHPStorm
|
||||
|
||||
Within PHPStorm goto `File` and then click `Open`. Select the local path you just did like `/Users/HDVinnie/Documents/Personal/UNIT3D-Community-Edition`.
|
||||
|
||||
### The following commands are run in PHPStorm. Can do so by clicking `Tools->Run Command`.
|
||||
|
||||
## Step 3: Start Sail
|
||||
## Step 3: start Sail
|
||||
Initialize the Docker environment using Laravel Sail:
|
||||
|
||||
```bash
|
||||
./vendor/bin/sail up -d
|
||||
```
|
||||
|
||||
## Step 4: Composer Dependency Installation
|
||||
## Step 4: Composer dependency installation
|
||||
|
||||
```bash
|
||||
./vendor/bin/sail composer install
|
||||
```
|
||||
|
||||
## Step 5: Bun Dependency Install and Compile Assets
|
||||
## Step 5: Bun dependency install and compile assets
|
||||
|
||||
```bash
|
||||
./vendor/bin/sail bun install
|
||||
@@ -88,7 +88,7 @@ Initialize the Docker environment using Laravel Sail:
|
||||
./vendor/bin/sail bun run build
|
||||
```
|
||||
|
||||
## Step 6: Database Migrations and Seeders
|
||||
## Step 6: database migrations and seeders
|
||||
|
||||
For database initialization with sample data, apply migrations and seeders:
|
||||
|
||||
@@ -99,14 +99,14 @@ For database initialization with sample data, apply migrations and seeders:
|
||||
**Caution**: This operation will reset your database and seed it with default data. Exercise caution in production
|
||||
settings.
|
||||
|
||||
## Step 7: Database Preparation (If want to use a production database backup locally)
|
||||
## Step 7: database preparation (if want to use a production database backup locally)
|
||||
|
||||
### Initial Database Loading
|
||||
### Initial database loading
|
||||
|
||||
Prepare your database with the initial schema and data. Ensure you have a database dump file,
|
||||
e.g., `prod-site-backup.sql`.
|
||||
|
||||
### MySQL Data Importation
|
||||
### MySQL data importation
|
||||
|
||||
To import your database dump into MySQL within the local environment, use:
|
||||
|
||||
@@ -116,7 +116,7 @@ To import your database dump into MySQL within the local environment, use:
|
||||
|
||||
**Note**: For this to work properly you must set the APP_KEY value in your local `.env` file to match you prod APP_KEY value.
|
||||
|
||||
## Step 8: Application Cache Configuration
|
||||
## Step 8: application cache configuration
|
||||
|
||||
Optimize the application's performance by setting up the cache:
|
||||
|
||||
@@ -124,48 +124,48 @@ Optimize the application's performance by setting up the cache:
|
||||
sail artisan set:all_cache
|
||||
```
|
||||
|
||||
## Step 9: Visit Local Instance
|
||||
## Step 9: visit local instance
|
||||
|
||||
Open your browser and visit `localhost`. Enjoy!
|
||||
|
||||
## Additional Notes
|
||||
## Additional notes
|
||||
|
||||
- **Permissions**: Exercise caution with `sudo` to avoid permission conflicts, particularly for Docker commands
|
||||
requiring elevated access.
|
||||
|
||||
### Appendix: Sail Commands for UNIT3D
|
||||
### Appendix: Sail commands for UNIT3D
|
||||
|
||||
This section outlines commands for managing and interacting with UNIT3D using Laravel Sail.
|
||||
|
||||
#### Sail Management
|
||||
#### Sail management
|
||||
|
||||
- **Start Environment**:
|
||||
- **Start environment**:
|
||||
```bash
|
||||
./vendor/bin/sail up -d
|
||||
```
|
||||
Starts Docker containers in detached mode.
|
||||
|
||||
- **Stop Environment**:
|
||||
- **Stop environment**:
|
||||
```bash
|
||||
./vendor/bin/sail down -v
|
||||
```
|
||||
Stops and removes Docker containers.
|
||||
|
||||
- **Restart Environment**:
|
||||
- **Restart environment**:
|
||||
```bash
|
||||
./vendor/bin/sail restart
|
||||
```
|
||||
Applies changes by restarting Docker environment.
|
||||
|
||||
#### Dependency Management
|
||||
#### Dependency management
|
||||
|
||||
- **Install Composer Dependencies**:
|
||||
- **Install Composer dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail composer install
|
||||
```
|
||||
Installs PHP dependencies defined in `composer.json`.
|
||||
|
||||
- **Update Composer Dependencies**:
|
||||
- **Update Composer dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail composer update
|
||||
```
|
||||
@@ -173,55 +173,55 @@ This section outlines commands for managing and interacting with UNIT3D using La
|
||||
|
||||
#### Laravel Artisan
|
||||
|
||||
- **Run Migrations**:
|
||||
- **Run migrations**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan migrate
|
||||
```
|
||||
Executes database migrations.
|
||||
|
||||
- **Seed Database**:
|
||||
- **Seed database**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan db:seed
|
||||
```
|
||||
Seeds database with predefined data.
|
||||
|
||||
- **Refresh Database**:
|
||||
- **Refresh database**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan migrate:fresh --seed
|
||||
```
|
||||
Resets and seeds database.
|
||||
|
||||
- **Cache Configurations**:
|
||||
- **Cache configurations**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan set:all_cache
|
||||
```
|
||||
Clears and caches configurations for performance.
|
||||
|
||||
#### NPM and Assets
|
||||
#### NPM and assets
|
||||
|
||||
- **Install Bun Dependencies**:
|
||||
- **Install Bun dependencies**:
|
||||
```bash
|
||||
./vendor/bin/sail bun install
|
||||
```
|
||||
Installs Node.js dependencies.
|
||||
|
||||
- **Compile Assets**:
|
||||
- **Compile assets**:
|
||||
```bash
|
||||
./vendor/bin/sail bun run build
|
||||
```
|
||||
Compiles CSS and JavaScript assets.
|
||||
|
||||
#### Database Operations
|
||||
#### Database operations
|
||||
|
||||
- **MySQL Interaction**:
|
||||
- **MySQL interaction**:
|
||||
```bash
|
||||
./vendor/bin/sail mysql -u root -p
|
||||
```
|
||||
Opens MySQL CLI for database interaction.
|
||||
|
||||
#### Queue Management
|
||||
#### Queue management
|
||||
|
||||
- **Restart Queue Workers**:
|
||||
- **Restart queue workers**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan queue:restart
|
||||
```
|
||||
@@ -229,14 +229,14 @@ This section outlines commands for managing and interacting with UNIT3D using La
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
- **View Logs**:
|
||||
- **View logs**:
|
||||
```bash
|
||||
./vendor/bin/sail logs
|
||||
```
|
||||
Displays Docker container logs.
|
||||
|
||||
- **PHPUnit (PEST) Tests**:
|
||||
- **PHPUnit (PEST) tests**:
|
||||
```bash
|
||||
./vendor/bin/sail artisan test
|
||||
```
|
||||
Runs PEST tests for application.
|
||||
Runs PEST tests for application.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Meilisearch Setup for UNIT3D
|
||||
# Meilisearch setup for UNIT3D
|
||||
|
||||
**Note:** This guide assumes you are using a `sudo` user named `ubuntu`.
|
||||
|
||||
## 1. Install and Configure Meilisearch
|
||||
## 1. Install and configure Meilisearch
|
||||
|
||||
1. **Install Meilisearch:**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
sudo chmod +x /usr/local/bin/meilisearch
|
||||
```
|
||||
|
||||
2. **Set Up Directories:**
|
||||
2. **Set up directories:**
|
||||
|
||||
```sh
|
||||
sudo mkdir -p /var/lib/meilisearch/data /var/lib/meilisearch/dumps /var/lib/meilisearch/snapshots
|
||||
@@ -20,7 +20,7 @@
|
||||
sudo chmod -R 750 /var/lib/meilisearch
|
||||
```
|
||||
|
||||
3. **Generate and Record a Master Key:**
|
||||
3. **Generate and record a master key:**
|
||||
|
||||
Generate a 16-byte master key:
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
snapshot_dir = "/var/lib/meilisearch/snapshots"
|
||||
```
|
||||
|
||||
5. **Create and Enable Service:**
|
||||
5. **Create and enable service:**
|
||||
|
||||
```sh
|
||||
sudo nano /etc/systemd/system/meilisearch.service
|
||||
@@ -96,7 +96,7 @@
|
||||
MEILISEARCH_KEY=your_16_byte_master_key
|
||||
```
|
||||
|
||||
2. **Clear Configuration and Restart Services:**
|
||||
2. **Clear configuration and restart services:**
|
||||
|
||||
```sh
|
||||
sudo php artisan set:all_cache
|
||||
@@ -106,20 +106,24 @@
|
||||
|
||||
## 3. Maintenance
|
||||
|
||||
1. **Reload Data and Sync Indexes:**
|
||||
1. **Reload data and sync indexes:**
|
||||
|
||||
- **Sync Index Settings:** After UNIT3D updates, sync the index settings to ensure they are up to date:
|
||||
- **Sync index settings:**
|
||||
|
||||
After UNIT3D updates, sync the index settings to ensure they are up to date:
|
||||
|
||||
```sh
|
||||
sudo php artisan scout:sync-index-settings
|
||||
```
|
||||
|
||||
- **Reload Data:** Whenever Meilisearch is upgraded or during the initial setup, the database must be reloaded:
|
||||
- **Reload data:**
|
||||
|
||||
Whenever Meilisearch is upgraded or during the initial setup, the database must be reloaded:
|
||||
|
||||
```sh
|
||||
sudo php artisan auto:sync_torrents_to_meilisearch --wipe && sudo php artisan auto:sync_people_to_meilisearch
|
||||
```
|
||||
|
||||
## See Also
|
||||
## See also
|
||||
|
||||
For further details, refer to the [official Meilisearch documentation](https://www.meilisearch.com/docs/guides/deployment/running_production).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Server Management
|
||||
# Server management
|
||||
|
||||
<!-- cspell:ignore certbot,chgrp,usermod -->
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
> - The project root directory is located at `/var/www/html`.
|
||||
> - All commands are run from the project root directory.
|
||||
|
||||
## 1. Elevated Shell
|
||||
## 1. Elevated shell
|
||||
|
||||
All SSH and SFTP operations should be conducted using the non-root user. Use `sudo` for any commands that require elevated privileges. Do not use the `root` user directly.
|
||||
|
||||
## 2. File Permissions
|
||||
## 2. File permissions
|
||||
|
||||
Ensure that everything in `/var/www/html` is owned by `www-data:www-data`, except for `node_modules`, which should be owned by `root:root`.
|
||||
|
||||
@@ -30,9 +30,9 @@ sudo chmod -R ug+rwx storage bootstrap/cache
|
||||
sudo rm -rf node_modules && sudo bun install && sudo bun run build
|
||||
```
|
||||
|
||||
## 3. Handling Code Changes
|
||||
## 3. Handling code changes
|
||||
|
||||
### PHP Changes
|
||||
### PHP changes
|
||||
|
||||
If any PHP files are modified, run the following commands to clear the cache, restart the PHP-FPM service, and restart the Laravel queues:
|
||||
|
||||
@@ -40,7 +40,7 @@ If any PHP files are modified, run the following commands to clear the cache, re
|
||||
sudo php artisan set:all_cache && sudo systemctl restart php8.3-fpm && sudo php artisan queue:restart
|
||||
```
|
||||
|
||||
### Static Assets (SCSS, JS)
|
||||
### Static assets (SCSS, JS)
|
||||
|
||||
If you make changes to SCSS or JavaScript files, rebuild the static assets using:
|
||||
|
||||
@@ -48,9 +48,9 @@ If you make changes to SCSS or JavaScript files, rebuild the static assets using
|
||||
bun run build
|
||||
```
|
||||
|
||||
## 4. Changing the Domain
|
||||
## 4. Changing the domain
|
||||
|
||||
1. **Update the Environment Variables:**
|
||||
1. **Update the environment variables:**
|
||||
|
||||
Modify the domain in the `APP_URL` and `MIX_ECHO_ADDRESS` variables within the `.env` file:
|
||||
|
||||
@@ -58,7 +58,7 @@ bun run build
|
||||
sudo nano ./.env
|
||||
```
|
||||
|
||||
2. **Refresh the TLS Certificate:**
|
||||
2. **Refresh the TLS certificate:**
|
||||
|
||||
Use `certbot` to refresh the TLS certificate:
|
||||
|
||||
@@ -66,7 +66,7 @@ bun run build
|
||||
certbot --redirect --nginx -n --agree-tos --email=sysop@your_domain.tld -d your_domain.tld -d www.your_domain.tld --rsa-key-size 2048
|
||||
```
|
||||
|
||||
3. **Update the WebSocket Configuration:**
|
||||
3. **Update the WebSocket configuration:**
|
||||
|
||||
Update all domains listed in the WebSocket configuration to reflect the new domain:
|
||||
|
||||
@@ -74,7 +74,7 @@ bun run build
|
||||
sudo nano ./laravel-echo-server.json
|
||||
```
|
||||
|
||||
4. **Restart the Chatbox Server:**
|
||||
4. **Restart the chatbox server:**
|
||||
|
||||
Reload the Supervisor configuration to apply changes:
|
||||
|
||||
@@ -82,7 +82,7 @@ bun run build
|
||||
sudo supervisorctl reload
|
||||
```
|
||||
|
||||
5. **Compile Static Assets:**
|
||||
5. **Compile static assets:**
|
||||
|
||||
Rebuild the static assets:
|
||||
|
||||
@@ -90,7 +90,6 @@ bun run build
|
||||
bun run build
|
||||
```
|
||||
|
||||
## 5. Meilisearch Maintenance
|
||||
## 5. Meilisearch maintenance
|
||||
|
||||
Refer [Meilisearch setup for UNIT3D](https://github.com/HDInnovations/UNIT3D-Community-Edition/wiki/Meilisearch-Setup-for-UNIT3D), specifically the [maintenance](https://github.com/HDInnovations/UNIT3D-Community-Edition/wiki/Meilisearch-Setup-for-UNIT3D#3-maintenance) section, for managing upgrades and syncing indexes.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# UNIT3D Open Source: How to Share Your Source Code
|
||||
# UNIT3D open source: how to share your source code
|
||||
|
||||
_A guide by EkoNesLeg_
|
||||
|
||||
@@ -6,13 +6,13 @@ _A guide by EkoNesLeg_
|
||||
|
||||
As part of complying with the [GNU Affero General Public License (AGPL)](https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/LICENSE), sites that modify and distribute UNIT3D are required to share their source code. This guide provides an easy process for creating a sanitized tarball of your modified source code and encourages you to create and update an "Open Source" page on your site to make this code available.
|
||||
|
||||
## 2. Setting Up Tarball Creation
|
||||
## 2. Setting up tarball creation
|
||||
|
||||
### 2.1 Exclude Sensitive Files
|
||||
### 2.1 Exclude sensitive files
|
||||
|
||||
To create a tarball that includes only the modified source code and excludes sensitive files like configuration data, you can take advantage of the existing `.gitignore` file in your UNIT3D deployment. Here’s how:
|
||||
|
||||
1. **Reference `.gitignore` for Exclusions:**
|
||||
1. **Reference `.gitignore` for exclusions:**
|
||||
|
||||
If your production environment has the original `.gitignore` file that already lists the files and directories you don’t want to include in version control, you can use it to exclude those same items from your tarball:
|
||||
|
||||
@@ -20,7 +20,7 @@ To create a tarball that includes only the modified source code and excludes sen
|
||||
ln -s /var/www/html/.gitignore /var/www/html/.tarball_exclude
|
||||
```
|
||||
|
||||
2. **Additional Exclusions (if needed):**
|
||||
2. **Additional exclusions (if needed):**
|
||||
|
||||
If additional exclusions are needed, or if you've removed the git environment from your production environment, you should manually add the exclusions to the `.tarball_exclude` file:
|
||||
|
||||
@@ -82,7 +82,7 @@ To create a tarball that includes only the modified source code and excludes sen
|
||||
```
|
||||
<!-- cspell:enable -->
|
||||
|
||||
### 2.2 Create the Tarball
|
||||
### 2.2 Create the tarball
|
||||
|
||||
1. **Create a script to generate the tarball:**
|
||||
|
||||
@@ -116,22 +116,22 @@ To create a tarball that includes only the modified source code and excludes sen
|
||||
/var/www/html/create_tarball.sh
|
||||
```
|
||||
|
||||
## 3. Creating and Updating the Open Source Page
|
||||
## 3. Creating and updating the "Open source" Page
|
||||
|
||||
1. **Create an Open Source page:**
|
||||
1. **Create an "Open source" page:**
|
||||
|
||||
Go to your site's `/dashboard/pages` section and create a new page called "Open Source."
|
||||
Go to your site's `/dashboard/pages` section and create a new page called "Open source."
|
||||
|
||||
2. **Add the following Markdown content to the page:**
|
||||
|
||||
```markdown
|
||||
## Open Source
|
||||
## Open source
|
||||
|
||||
We comply with the UNIT3D's GNU Affero General Public License (AGPL) by sharing our modified source code. You can download the latest version of our source code below.
|
||||
|
||||
- **[Download Latest Source Code](/UNIT3D_Source_LATEST.tar.gz)**
|
||||
|
||||
### License Information
|
||||
### License information
|
||||
|
||||
Our site runs on a modified version of [UNIT3D](https://github.com/HDInnovations/UNIT3D-Community-Edition). For more details on the license, visit the [GNU AGPL License](https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/LICENSE).
|
||||
```
|
||||
@@ -140,6 +140,6 @@ To create a tarball that includes only the modified source code and excludes sen
|
||||
|
||||
After running the tarball creation script, update the page content if necessary to reflect any changes or additional notes about the modifications made.
|
||||
|
||||
## 4. Encouraging Compliance and Contributions
|
||||
## 4. Encouraging compliance and contributions
|
||||
|
||||
By publicly sharing your modified source code, you not only comply with the AGPL but also contribute to the open-source community. We encourage sites to contribute their changes back to the upstream repository by submitting pull requests, which helps improve UNIT3D for everyone.
|
||||
By publicly sharing your modified source code, you not only comply with the AGPL but also contribute to the open-source community. We encourage sites to contribute their changes back to the upstream repository by submitting pull requests, which helps improve UNIT3D for everyone.
|
||||
|
||||
+11
-11
@@ -6,16 +6,16 @@ UNIT3D is offering a new `{JSON:API}`. If you haven't already head over to your
|
||||
|
||||
## Ecosystem
|
||||
|
||||
### Torrent Auto Uploaders
|
||||
### Torrent auto uploaders
|
||||
|
||||
- [L4G's Upload Assistant](https://github.com/Audionut/Upload-Assistant) — a simple tool to take the work out of uploading
|
||||
- [GG Bot Upload Assistant](https://gitlab.com/NoobMaster669/gg-bot-upload-assistant) — a torrent auto uploader to take the manual work out of uploading
|
||||
|
||||
## API Authentication
|
||||
## API authentication
|
||||
|
||||
There are several ways of passing the API token to UNIT3D. We'll discuss each of these approaches while using the Guzzle HTTP library to demonstrate their usage. You may choose any of these approaches based on your needs to communicate with our API.
|
||||
|
||||
- **Query String**
|
||||
- **Query string**
|
||||
|
||||
UNIT3D's API consumers may specify their token as an `api_token` query string value:
|
||||
|
||||
@@ -23,7 +23,7 @@ There are several ways of passing the API token to UNIT3D. We'll discuss each of
|
||||
$response = $client->request('GET', '/api/torrents?api_token=YOUR_TOKEN_HERE);
|
||||
```
|
||||
|
||||
- **Request Payload**
|
||||
- **Request payload**
|
||||
|
||||
UNIT3D's API consumers may include their API token in the request's form parameters as an `api_token`:
|
||||
|
||||
@@ -38,7 +38,7 @@ There are several ways of passing the API token to UNIT3D. We'll discuss each of
|
||||
]);
|
||||
```
|
||||
|
||||
- **Bearer Token**
|
||||
- **Bearer token**
|
||||
|
||||
UNIT3D's API consumers may provide their API token as a `Bearer` token in the `Authorization` header of the request:
|
||||
|
||||
@@ -51,9 +51,9 @@ There are several ways of passing the API token to UNIT3D. We'll discuss each of
|
||||
]);
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
## API endpoints
|
||||
|
||||
### Upload a Torrent
|
||||
### Upload a torrent
|
||||
|
||||
Endpoint: POST `/api/torrents/upload`
|
||||
|
||||
@@ -92,7 +92,7 @@ Parameters:
|
||||
|
||||
*Only available to staff and internal users.
|
||||
|
||||
### Fetch a Torrent
|
||||
### Fetch a torrent
|
||||
|
||||
Endpoint: GET `/api/torrents/:id`
|
||||
|
||||
@@ -102,7 +102,7 @@ Example:
|
||||
https://unit3d.site/api/torrents/39765?api_token=YOURTOKENHERE
|
||||
```
|
||||
|
||||
### Fetch Torrents Index (Latest 25 Torrents)
|
||||
### Fetch torrents index (latest 25 torrents)
|
||||
|
||||
Endpoint: GET `/api/torrents`
|
||||
|
||||
@@ -112,7 +112,7 @@ Example:
|
||||
https://unit3d.site/api/torrents?api_token=YOURTOKENHERE
|
||||
```
|
||||
|
||||
### Filter Torrents
|
||||
### Filter torrents
|
||||
|
||||
Endpoint: GET `/api/torrents/filter`
|
||||
|
||||
@@ -161,7 +161,7 @@ Example:
|
||||
https://unit3d.site/api/torrents/filter?tmdbId=475557&categories[]=1&api_token=YOURTOKENHERE
|
||||
```
|
||||
|
||||
### Personal Account Info
|
||||
### Personal account info
|
||||
|
||||
Endpoint: GET `/api/user`
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Upgrading PHP Version
|
||||
# Upgrading PHP version
|
||||
|
||||
<!-- cspell:ignore ondrej,autoremove,debconf-utils,dpkg -->
|
||||
|
||||
@@ -205,4 +205,4 @@ You should now be running PHP8.3 and can confirm by checking your staff dashboar
|
||||
|
||||
NOTE: If you had tuning done on PHP 8.2 you will need to reapply them to new PHP 8.3 configs.
|
||||
`sudo nano /etc/php/8.3/fpm/pool.d/www.conf`
|
||||
`sudo nano /etc/php/8.3/fpm/php.ini`
|
||||
`sudo nano /etc/php/8.3/fpm/php.ini`
|
||||
|
||||
Reference in New Issue
Block a user