diff --git a/.env.example b/.env.example index 791885d..5bfd4a9 100755 --- a/.env.example +++ b/.env.example @@ -64,12 +64,3 @@ GITHUB_CLIENT_SECRET= ABLY_KEY= ABLY_PUBLIC_KEY= - -STRIPE_KEY=pk_test_NndNPdqsaU772F7rGf9VwMBZ00QTxVOAZI -STRIPE_SECRET=sk_test_nXrcZWPhxtzVLDWo3qzk5O2e00ygZPvrAJ -STRIPE_STANDARD_MONTHLY=price_1KJelHLZWr04YoNXo85HB9L6 -STRIPE_STANDARD_ANNUALLY=price_1KJelHLZWr04YoNX5JzxilBB -STRIPE_BUSINESS_MONTHLY=price_1KJelHLZWr04YoNX6rdAxIEA -STRIPE_BUSINESS_ANNUALLY=price_1KJelHLZWr04YoNXAoBOSLs9 -#STRIPE_UNLIMITED_MONTHLY=price_1KJelHLZWr04YoNXDRvMP511 -#STRIPE_UNLIMITED_ANNUALLY=price_1KJelHLZWr04YoNXG4Ad4Bjp diff --git a/.env.prod b/.env.prod new file mode 100755 index 0000000..d1dba6a --- /dev/null +++ b/.env.prod @@ -0,0 +1,60 @@ +APP_NAME=Vito +APP_ENV=production +APP_KEY= +APP_DEBUG=false +APP_URL={APP_URL} + +LOG_CHANNEL=stack +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE={DB_NAME} +DB_USERNAME={DB_USER} +DB_PASSWORD={DB_PASS} + +BROADCAST_DRIVER=pusher +CACHE_DRIVER=array +FILESYSTEM_DRIVER=local +QUEUE_CONNECTION=default +SESSION_DRIVER=database +SESSION_LIFETIME=120 + +MAIL_MAILER=smtp +MAIL_HOST=mailhog +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +PUSHER_APP_ID=app-id +PUSHER_APP_KEY=app-key +PUSHER_APP_SECRET=app-secret +PUSHER_HOST=soketi +PUSHER_PORT=6001 +PUSHER_SCHEME=http +PUSHER_APP_CLUSTER=mt1 + +VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_HOST="${PUSHER_HOST}" +VITE_PUSHER_PORT="${PUSHER_PORT}" +VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" +VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +SSH_PUBLIC_KEY_NAME=ssh-public.key +SSH_PRIVATE_KEY_NAME=ssh-private.pem + +GITHUB_CLIENT_ID= +GITHUB_CLIENT_SECRET= + +ABLY_KEY= +ABLY_PUBLIC_KEY= diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php deleted file mode 100644 index d13b001..0000000 --- a/app/Providers/TelescopeServiceProvider.php +++ /dev/null @@ -1,65 +0,0 @@ -hideSensitiveRequestDetails(); - - Telescope::filter(function (IncomingEntry $entry) { - if ($this->app->environment('local')) { - return true; - } - - return $entry->isReportableException() || - $entry->isFailedRequest() || - $entry->isFailedJob() || - $entry->isScheduledTask() || - $entry->hasMonitoredTag(); - }); - } - - /** - * Prevent sensitive request details from being logged by Telescope. - */ - protected function hideSensitiveRequestDetails(): void - { - if ($this->app->environment('local')) { - return; - } - - Telescope::hideRequestParameters(['_token']); - - Telescope::hideRequestHeaders([ - 'cookie', - 'x-csrf-token', - 'x-xsrf-token', - ]); - } - - /** - * Register the Telescope gate. - * - * This gate determines who can access Telescope in non-local environments. - */ - protected function gate(): void - { - Gate::define('viewTelescope', function ($user) { - return in_array($user->email, [ - // - ]); - }); - } -} diff --git a/composer.json b/composer.json index 8edbce9..396ba20 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,6 @@ "fakerphp/faker": "^1.9.1", "laravel/pint": "^1.10", "laravel/sail": "^1.18", - "laravel/telescope": "^4.14", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", "phpunit/phpunit": "^10.0", diff --git a/composer.lock b/composer.lock index 1d265ba..759bc16 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c1707f21542e1ae2b8839cd24e846e51", + "content-hash": "36fda0bafd1bd5b298307b02bb98fc0a", "packages": [ { "name": "aws/aws-crt-php", @@ -6790,77 +6790,6 @@ }, "time": "2023-03-30T12:28:55+00:00" }, - { - "name": "laravel/telescope", - "version": "v4.14.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/telescope.git", - "reference": "88ca4cbeefea563b605cf3fd9c10ff5a623864b1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/telescope/zipball/88ca4cbeefea563b605cf3fd9c10ff5a623864b1", - "reference": "88ca4cbeefea563b605cf3fd9c10ff5a623864b1", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laravel/framework": "^8.37|^9.0|^10.0", - "php": "^8.0", - "symfony/var-dumper": "^5.0|^6.0" - }, - "require-dev": { - "ext-gd": "*", - "guzzlehttp/guzzle": "^6.0|^7.0", - "laravel/octane": "^1.4", - "orchestra/testbench": "^6.0|^7.0|^8.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Telescope\\TelescopeServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Telescope\\": "src/", - "Laravel\\Telescope\\Database\\Factories\\": "database/factories/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - }, - { - "name": "Mohamed Said", - "email": "mohamed@laravel.com" - } - ], - "description": "An elegant debug assistant for the Laravel framework.", - "keywords": [ - "debugging", - "laravel", - "monitoring" - ], - "support": { - "issues": "https://github.com/laravel/telescope/issues", - "source": "https://github.com/laravel/telescope/tree/v4.14.1" - }, - "time": "2023-03-17T18:13:19+00:00" - }, { "name": "mockery/mockery", "version": "1.5.1", diff --git a/config/app.php b/config/app.php index 7d9462e..646ffe5 100644 --- a/config/app.php +++ b/config/app.php @@ -193,9 +193,7 @@ App\Providers\AuthServiceProvider::class, App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, - App\Providers\TelescopeServiceProvider::class, - + App\Providers\RouteServiceProvider::class ], /* diff --git a/config/telescope.php b/config/telescope.php deleted file mode 100644 index 9a09fda..0000000 --- a/config/telescope.php +++ /dev/null @@ -1,187 +0,0 @@ - env('TELESCOPE_DOMAIN'), - - /* - |-------------------------------------------------------------------------- - | Telescope Path - |-------------------------------------------------------------------------- - | - | This is the URI path where Telescope will be accessible from. Feel free - | to change this path to anything you like. Note that the URI will not - | affect the paths of its internal API that aren't exposed to users. - | - */ - - 'path' => env('TELESCOPE_PATH', 'telescope'), - - /* - |-------------------------------------------------------------------------- - | Telescope Storage Driver - |-------------------------------------------------------------------------- - | - | This configuration options determines the storage driver that will - | be used to store Telescope's data. In addition, you may set any - | custom options as needed by the particular driver you choose. - | - */ - - 'driver' => env('TELESCOPE_DRIVER', 'database'), - - 'storage' => [ - 'database' => [ - 'connection' => env('DB_CONNECTION', 'mysql'), - 'chunk' => 1000, - ], - ], - - /* - |-------------------------------------------------------------------------- - | Telescope Master Switch - |-------------------------------------------------------------------------- - | - | This option may be used to disable all Telescope watchers regardless - | of their individual configuration, which simply provides a single - | and convenient way to enable or disable Telescope data storage. - | - */ - - 'enabled' => env('TELESCOPE_ENABLED', true), - - /* - |-------------------------------------------------------------------------- - | Telescope Route Middleware - |-------------------------------------------------------------------------- - | - | These middleware will be assigned to every Telescope route, giving you - | the chance to add your own middleware to this list or change any of - | the existing middleware. Or, you can simply stick with this list. - | - */ - - 'middleware' => [ - 'web', - Authorize::class, - ], - - /* - |-------------------------------------------------------------------------- - | Allowed / Ignored Paths & Commands - |-------------------------------------------------------------------------- - | - | The following array lists the URI paths and Artisan commands that will - | not be watched by Telescope. In addition to this list, some Laravel - | commands, like migrations and queue commands, are always ignored. - | - */ - - 'only_paths' => [ - // 'api/*' - ], - - 'ignore_paths' => [ - 'nova-api*', - ], - - 'ignore_commands' => [ - // - ], - - /* - |-------------------------------------------------------------------------- - | Telescope Watchers - |-------------------------------------------------------------------------- - | - | The following array lists the "watchers" that will be registered with - | Telescope. The watchers gather the application's profile data when - | a request or task is executed. Feel free to customize this list. - | - */ - - 'watchers' => [ - Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true), - - Watchers\CacheWatcher::class => [ - 'enabled' => env('TELESCOPE_CACHE_WATCHER', true), - 'hidden' => [], - ], - - Watchers\ClientRequestWatcher::class => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true), - - Watchers\CommandWatcher::class => [ - 'enabled' => env('TELESCOPE_COMMAND_WATCHER', true), - 'ignore' => [], - ], - - Watchers\DumpWatcher::class => [ - 'enabled' => env('TELESCOPE_DUMP_WATCHER', true), - 'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false), - ], - - Watchers\EventWatcher::class => [ - 'enabled' => env('TELESCOPE_EVENT_WATCHER', true), - 'ignore' => [], - ], - - Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true), - - Watchers\GateWatcher::class => [ - 'enabled' => env('TELESCOPE_GATE_WATCHER', true), - 'ignore_abilities' => [], - 'ignore_packages' => true, - 'ignore_paths' => [], - ], - - Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true), - - Watchers\LogWatcher::class => [ - 'enabled' => env('TELESCOPE_LOG_WATCHER', true), - 'level' => 'error', - ], - - Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true), - - Watchers\ModelWatcher::class => [ - 'enabled' => env('TELESCOPE_MODEL_WATCHER', true), - 'events' => ['eloquent.*'], - 'hydrations' => true, - ], - - Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true), - - Watchers\QueryWatcher::class => [ - 'enabled' => env('TELESCOPE_QUERY_WATCHER', true), - 'ignore_packages' => true, - 'ignore_paths' => [], - 'slow' => 100, - ], - - Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true), - - Watchers\RequestWatcher::class => [ - 'enabled' => env('TELESCOPE_REQUEST_WATCHER', true), - 'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64), - 'ignore_http_methods' => [], - 'ignore_status_codes' => [], - ], - - Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true), - Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true), - ], -]; diff --git a/install/install.sh b/install/install.sh new file mode 100644 index 0000000..81d5903 --- /dev/null +++ b/install/install.sh @@ -0,0 +1,193 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive +export NEEDRESTART_MODE=a +export V_USERNAME=vito +export V_PASSWORD=$(openssl rand -base64 12) + +if [[ -z "${V_DOMAIN}" ]]; then + echo "Error: V_DOMAIN environment variable is not set." + exit 1 +fi + +apt remove needrestart -y + +useradd -p $(openssl passwd -1 ${V_PASSWORD}) ${V_USERNAME} +usermod -aG "${V_USERNAME}" +"${V_USERNAME} ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers +mkdir /home/"${V_USERNAME}" +mkdir /home/"${V_USERNAME}"/.ssh +chown -R "${V_USERNAME}":"${V_USERNAME}" /home/"${V_USERNAME}" +chsh -s /bin/bash "${V_USERNAME}" +su - "${V_USERNAME}" -c "ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa" <<