diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index 8744da671..c6a5b3273 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -22,11 +22,6 @@ ## 3) Start & setup Coolify - Run `spin up` - You can notice that errors will be thrown. Don't worry. - If you see weird permission errors, especially on Mac, run `sudo spin up` instead. -If you are running Coolify for the first time: -- Run `./scripts/run dev:init` - This will delete any existing database layouts, migrate database to the new layout, and seed your database. - -> If you see the login page with a 404 error, you forgot to run `./scripts/run dev:init`. - ### 4) Start development You can login your Coolify instance at `localhost:8000` with `test@example.com` and `password`. diff --git a/app/Console/Commands/Dev.php b/app/Console/Commands/Dev.php new file mode 100644 index 000000000..ba60826d1 --- /dev/null +++ b/app/Console/Commands/Dev.php @@ -0,0 +1,33 @@ +showQueries()->color('orange'); - if (showBoarding() && !in_array($request->path(), allowedPathsForBoardingAccounts())) { - if (Str::startsWith($request->path(), 'invitations')) { - return $next($request); - } - return redirect('boarding'); - } - return $next($request); - } -} diff --git a/app/Http/Middleware/NOTUSEDIsSubscriptionValid.php b/app/Http/Middleware/NOTUSEDIsSubscriptionValid.php deleted file mode 100644 index 5774e5190..000000000 --- a/app/Http/Middleware/NOTUSEDIsSubscriptionValid.php +++ /dev/null @@ -1,45 +0,0 @@ -user() || !isCloud()) { - if ($request->path() === 'subscription') { - return redirect('/'); - } else { - return $next($request); - } - } - if (isSubscriptionActive() && $request->path() === 'subscription') { - // ray('active subscription Middleware'); - return redirect('/'); - } - if (isSubscriptionOnGracePeriod()) { - // ray('is_subscription_in_grace_period Middleware'); - return $next($request); - } - if (!isSubscriptionActive() && !isSubscriptionOnGracePeriod()) { - // ray('SubscriptionValid Middleware'); - if (!in_array($request->path(), allowedPathsForUnsubscribedAccounts())) { - if (Str::startsWith($request->path(), 'invitations')) { - return $next($request); - } - return redirect('subscription'); - } else { - return $next($request); - } - } - return $next($request); - } -} diff --git a/database/factories/StandaloneMongoDBFactory.php b/database/factories/StandaloneMongoDBFactory.php deleted file mode 100644 index 8ec395e49..000000000 --- a/database/factories/StandaloneMongoDBFactory.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class StandaloneMongodbFactory extends Factory -{ - /** - * Define the model's default state. - * - * @return array - */ - public function definition(): array - { - return [ - // - ]; - } -} diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index e789c3ba7..a9f09efa3 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -70,6 +70,8 @@ services: volumes: - .:/var/www/html:cached command: sh -c "npm install && npm run dev" + networks: + - coolify testing-host: <<: *testing-host-base container_name: coolify-testing-host @@ -77,15 +79,8 @@ services: - /:/host - /var/run/docker.sock:/var/run/docker.sock - /data/coolify/:/data/coolify - # - coolify-data-dev:/data/coolify - # remote-host: - # <<: *testing-host-base - # container_name: coolify-remote-host - # volumes: - # - /:/host - # - /var/run/docker.sock:/var/run/docker.sock - # - /data/coolify/:/data/coolify - # # - coolify-data-dev:/data/coolify + networks: + - coolify mailpit: image: "axllent/mailpit:latest" container_name: coolify-mail @@ -116,8 +111,8 @@ volumes: coolify-redis-data-dev: coolify-minio-data-dev: + networks: - coolify: - name: coolify - driver: bridge - external: false + coolify: + name: coolify + external: false diff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up index e5d89d959..e974e54cc 100644 --- a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up +++ b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up @@ -1,4 +1,5 @@ #!/command/execlineb -P foreground { composer -d /var/www/html/ install } -foreground { php /var/www/html/artisan key:generate } foreground { php /var/www/html/artisan migrate --step } +foreground { php /var/www/html/artisan dev:init } + diff --git a/scripts/run b/scripts/run index 80ff17a16..dfb011c39 100755 --- a/scripts/run +++ b/scripts/run @@ -20,50 +20,50 @@ function help { compgen -A function | cat -n } -function dev:init { - docker exec coolify bash -c "php artisan migrate --seed" - echo "Need to update privileges on a few files. I need your password for that." - sudo chmod -R o+rwx . -} +# function dev:init { +# docker exec coolify bash -c "php artisan migrate --seed" +# echo "Need to update privileges on a few files. I need your password for that." +# sudo chmod -R o+rwx . +# } -function sync:v3 { - if [ -z "$1" ]; then - echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32" - exit 1 - fi - skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1 -} +# function sync:v3 { +# if [ -z "$1" ]; then +# echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32" +# exit 1 +# fi +# skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1 +# } function sync:bunny { php artisan sync:bunny --env=secrets } -function queue { - bash spin exec -u webuser coolify php artisan queue:listen -} +# function queue { +# bash spin exec -u webuser coolify php artisan queue:listen +# } -function horizon { - bash spin exec -u webuser coolify php artisan horizon -vvv -} +# function horizon { +# bash spin exec -u webuser coolify php artisan horizon -vvv +# } -function schedule { - bash spin exec -u webuser coolify php artisan schedule:work -} +# function schedule { +# bash spin exec -u webuser coolify php artisan schedule:work +# } -function schedule:run { - bash spin exec -u webuser coolify php artisan schedule:run -} +# function schedule:run { +# bash spin exec -u webuser coolify php artisan schedule:run +# } -function db { - bash spin exec -u webuser coolify php artisan db -} -function db:seed { - bash spin exec -u webuser coolify php artisan migrate --seed -} +# function db { +# bash spin exec -u webuser coolify php artisan db +# } +# function db:seed { +# bash spin exec -u webuser coolify php artisan migrate --seed +# } -function db:migrate { - bash spin exec -u webuser coolify php artisan migrate --step -} +# function db:migrate { +# bash spin exec -u webuser coolify php artisan migrate --step +# } function db:reset { bash spin exec -u webuser coolify php artisan migrate:fresh --seed @@ -101,9 +101,9 @@ function tinker { } -function build:helper { - act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets -} +# function build:helper { +# act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets +# } function default { help }