mirror of
https://github.com/sp-tarkov/db-website.git
synced 2025-02-08 04:50:46 -05:00
Updates README
This commit is contained in:
parent
c25b86a188
commit
fedfb6c5da
74
README.md
74
README.md
@ -1,55 +1,37 @@
|
|||||||
# SPT Items
|
# SPT DB Items Search
|
||||||
|
|
||||||
## Required secrets
|
Source for the SPT DB Item Lookup website hosted at:
|
||||||
| secret name | description | example |
|
https://db.sp-tarkov.com/
|
||||||
| :----------------- | :---------- | :------- |
|
|
||||||
| spt_items_hostname | The remote server where spt-items-finder will be reachable <br> used for the frontend resolution | spt-items.my.server.com |
|
|
||||||
| deploy_path | The path to deploy to in the remote machine | `/var/www/html/aki/Website/items` |
|
|
||||||
| deploy_hostname | The remote server where to deploy <br> used by Ansible SSH | my.server.com |
|
|
||||||
| deploy_username | The default username to use on the remote server <br> used by Ansible SSH | www-data |
|
|
||||||
| deploy_user_group | The default user group to use on the remote server <br> used to set permission on the website folder | www-data |
|
|
||||||
| deploy_ssh_key | The **content** of the ssh private key used to connect to the remote server <br> The key needs to be in RSA in "RSA PRIVATE KEY" format <br> The ssh publick key needs to already be in the user used in the remote server ~/.ssh/authorized_keys | -----BEGIN RSA PRIVATE KEY----- <br> The key <br> -----END RSA PRIVATE KEY----- |
|
|
||||||
| deploy_ssh_key_passphrase | The passphrase to decrypt the SSH private key | test |
|
|
||||||
|
|
||||||
## ⚠ Important notes for the deployment ⚠
|
## Required Secrets
|
||||||
* Add all required secrets in Drone
|
|
||||||
* Server permissions:
|
|
||||||
1. The server must be able to use `apt` package manager
|
|
||||||
1. The *deploy_usernam* must exists, be part of the group *deploy_user_group* and be able to SSH into the server
|
|
||||||
1. If the parent folder of *deploy_path* already exists, *deploy_username* must have read and write permissions on it
|
|
||||||
* PHP:
|
|
||||||
1. `php8.0-fpm` and all its dependencies must already be installed
|
|
||||||
1. `php8.0-fpm` must be configured to use *deploy_username* (to ensure the cache created by Laravel can be deleted before every new deployment)
|
|
||||||
* Nginx:
|
|
||||||
1. Nginx must be using uses the user group *deploy_user_group*
|
|
||||||
1. Nginx must be configured to use HTTPS
|
|
||||||
1. Nginx must be configured to listen to *spt_items_hostname* and to point to the *deploy_path*
|
|
||||||
|
|
||||||
|
| Secret Name | Description |
|
||||||
|
| :-------------- | :---------- |
|
||||||
|
| SSH_DEPLOY_HOST | The remote server host where deployments are pushed |
|
||||||
|
| SSH_PRIVATE_KEY | The private key that the SSH connection uses to connect to the remote server |
|
||||||
|
| SSH_KNOWN_HOSTS | The known_hosts entry for the remote server |
|
||||||
|
|
||||||
## The pipeline summary
|
## Local Build
|
||||||
* The Drone pipeline is based on Docker: [.drone-docker.yml](.drone-docker.yml)
|
|
||||||
* Some enhancement ideas can be found [here](#some-enhancement-ideas)
|
|
||||||
|
|
||||||
1. Each push will:
|
Requirements:
|
||||||
1. Test the frontend
|
- Node v20.12
|
||||||
2. IF on `development` or `master`/`main` branch
|
- Bun v1.1
|
||||||
1. Builds the frontend
|
|
||||||
3. IF pushed from `master` or `main` main branch
|
|
||||||
1. Move the build frontend in the backend `public` folder
|
|
||||||
2. Deploys to the server
|
|
||||||
|
|
||||||
## The pipeline walkthrough
|
Clone the repository into a local directory.
|
||||||
see [Walkthrough.md](./docs/Walkthrough.md)
|
|
||||||
|
|
||||||
## Some enhancement ideas
|
Build the front-end:
|
||||||
- Store the build so that it is not rebuilt on any `promote` event
|
- `cd frontend`
|
||||||
- Use a volume or a cache for Yarn install
|
- `npm install`
|
||||||
|
- `npm run build`
|
||||||
|
|
||||||
## Thanks
|
Move the front-end build into the back-end public directory:
|
||||||
- CWX
|
- `mkdir -p ../api/public`
|
||||||
|
- `cp -r dist/* ../api/public/`
|
||||||
|
|
||||||
## Cache refresh workaround
|
Build the back-end:
|
||||||
1. Navigate to `/var/www/html/aki/db-website/items/storage/framework/cache/data`
|
- `cd ../api`
|
||||||
2. Delete each cache folder
|
- `cp .env.example .env`
|
||||||
3. Use the site to search for an item
|
- `bun install`
|
||||||
4. New cache should be generated for the DB
|
|
||||||
|
Start the local server:
|
||||||
|
- `bun run start`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user