This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add sentry.php to configs * Add `debug-sentry` route
- Loading branch information
Showing
7 changed files
with
1,642 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_KEY=base64:g3cPbmSz3AC3CoGXtbK81jFgYJnobc4iT27AwRs+FQc= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
|
@@ -10,6 +10,7 @@ LOG_LEVEL=debug | |
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
# DB_HOST=mysql <-- for a local dev | ||
DB_PORT=3306 | ||
DB_DATABASE=secretnotes | ||
DB_USERNAME=root | ||
|
@@ -50,3 +51,6 @@ PUSHER_APP_CLUSTER=mt1 | |
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" | ||
|
||
SENTRY_LARAVEL_DSN=https://[email protected]/6382169 | ||
SENTRY_TRACES_SAMPLE_RATE=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,29 @@ | |
|
||
### Local development | ||
|
||
When you pull this project to another computer that has no PHP or Composer installed, you cant run `sail` command | ||
because there is no vendor folder. | ||
|
||
Solution is https://laravel.com/docs/9.x/sail#installing-composer-dependencies-for-existing-projects | ||
|
||
```bash | ||
docker run --rm \ | ||
-u "$(id -u):$(id -g)" \ | ||
-v $(pwd):/opt \ | ||
-w /opt \ | ||
laravelsail/php81-composer:latest \ | ||
composer install --ignore-platform-reqs | ||
``` | ||
Instead of repeatedly typing `vendor/bin/sail` to execute Sail commands, you may wish to configure a Bash alias: | ||
|
||
```bash | ||
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail' | ||
``` | ||
|
||
sail artisan migrate:fresh --seed | ||
|
||
>If needed, change DB_HOST to `mysql` (for local development) | ||
Чтобы собрать фронт (CSS, JS): | ||
sail npm run dev | ||
|
||
|
@@ -22,8 +45,8 @@ sail down --rmi all -v | |
|
||
Создаём VDS-виртуалку, например в [NetAngels](https://panel.netangels.ru). | ||
|
||
|
||
Заходим по SSH и проверяем версию PHP (`php -v). Если необходимо, [обновляемся до PHP 8](https://php.watch/articles/php-8.0-installation-update-guide-debian-ubuntu): | ||
Заходим по SSH и проверяем версию PHP (`php -v). Если | ||
необходимо, [обновляемся до PHP 8](https://php.watch/articles/php-8.0-installation-update-guide-debian-ubuntu): | ||
|
||
```bash | ||
sudo apt update | ||
|
@@ -56,25 +79,22 @@ php -r "unlink('composer-setup.php');" | |
sudo mv composer.phar /usr/local/bin/composer | ||
``` | ||
|
||
|
||
>Далее делаем всё от пользователя `web`, не `root`!!! | ||
> Далее делаем всё от пользователя `web`, не `root`!!! | ||
|
||
|
||
|
||
ssh-keygen | ||
|
||
|
||
|
||
|
||
В репозитории на GitHub, в разделе `Settings > Secrets > Actions` задаём значения: | ||
|
||
- `SSH_PRIVATE_KEY`. If you don’t have this you can run ssh-keygen in your server terminal to generate a new key, then run the command cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys to allow connection to the private key. | ||
- `SSH_PRIVATE_KEY`. If you don’t have this you can run ssh-keygen in your server terminal to generate a new key, then | ||
run the command cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys to allow connection to the private key. | ||
- `SSH_HOST`. This is the IP address of the server. | ||
- `SSH_USERNAME`. This is the server username, in my case it’s root . If you don’t know your username you can use the whoami command on your server to check. | ||
|
||
В репозитории, в разделе `Deploy keys`, задаём значение публичного ключа с виртуальной машины (получить можно через `cat ~/.ssh/id_rsa.pub`). Это позволит деплоиться через `git pull` с VDS. | ||
|
||
- `SSH_USERNAME`. This is the server username, in my case it’s root . If you don’t know your username you can use the | ||
whoami command on your server to check. | ||
|
||
В репозитории, в разделе `Deploy keys`, задаём значение публичного ключа с виртуальной машины (получить можно | ||
через `cat ~/.ssh/id_rsa.pub`). Это позволит деплоиться через `git pull` с VDS. | ||
|
||
/var/www/web/sites | ||
|
||
|
@@ -84,7 +104,6 @@ git clone [email protected]:gomzyakov/secretnotes.git secretnotes.ru | |
/var/www/web/sites/secretnotes.ru | ||
php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
composer install | ||
|
@@ -93,20 +112,16 @@ chmod -R 777 storage bootstrap/cache | |
php artisan key:generate | ||
Вносим корректные реквизиты в `.env` файл: | ||
Создаём БД `secretnotes` через phpMyAdmin | ||
Создаём БД `secretnotes` через phpMyAdmin | ||
php artisan migrate:fresh --seed | ||
## Front | ||
На виртуалке: | ||
cd ~ | ||
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh | ||
sudo bash /tmp/nodesource_setup.sh | ||
|
@@ -117,7 +132,6 @@ v16.6.1 | |
sudo apt install npm | ||
После этого билдим непосредственно фронтовые зависимости: | ||
npm install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.