Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release #362

Merged
merged 9 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/Models/Consultation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use EscolaLms\Cart\Contracts\Productable;
use EscolaLms\Cart\Contracts\ProductableTrait;
use EscolaLms\Cart\Models\Product;
use EscolaLms\Consultations\Enum\ConsultationTermStatusEnum;
use EscolaLms\Core\Models\User;
use Illuminate\Database\Eloquent\Collection;

Expand All @@ -19,7 +18,6 @@ public function attachToUser(User $user, int $quantity = 1, ?Product $product =
$data = [
'consultation_id' => $this->getKey(),
'user_id' => $user->getKey(),
'executed_status' => ConsultationTermStatusEnum::NOT_REPORTED,
'product_id' => $product ? $product->getKey() : null
];
parent::attachToConsultationPivot($data);
Expand Down
617 changes: 324 additions & 293 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
image: caddy
volumes:
- ./docker/conf/Caddyfile:/etc/caddy/Caddyfile
- ./:/var/www/html
- ./caddy/certs:/etc/caddy/certs
- ./caddy/data:/data
- ./caddy/config:/config
Expand All @@ -18,7 +17,6 @@ services:
- "80:80"
- "443:443"
api:
#command: "./init.sh"
#image: escolalms/php:8.2-prod ## or escolalms/php:8-work for debugginh
build:
context: .
Expand Down
11 changes: 5 additions & 6 deletions docker/conf/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,18 @@ http://*.app.localhost {


http://*.localhost {
# Resolve the root directory for the app
root * /var/www/html/public

# Provide Zstd and Gzip compression
encode zstd gzip

# Allow caddy to serve static files
file_server

# Enable PHP-FPM
php_fastcgi escola_lms_app:9000 {

reverse_proxy api:9000 {
header_up -Access-Control-Allow-Origin
header_down -Access-Control-Allow-Origin
transport fastcgi {
env SCRIPT_FILENAME /var/www/html/index.php
}
}

# Cors logic
Expand Down
2 changes: 1 addition & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ else
php artisan db:seed --class=PermissionsSeeder --force --no-interaction
fi

php artisan h5p:storage-link
php artisan h5p:storage-link --overwrite

touch inited

Expand Down
2 changes: 1 addition & 1 deletion init_multidomains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if [ -n "$MULTI_DOMAINS" ]; then
php artisan db:seed --domain=$domain --class=PermissionsSeeder --force --no-interaction
fi

php artisan h5p:storage-link --domain=$domain
php artisan h5p:storage-link --overwrite --domain=$domain

done
else
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ restart_queue_cron:
update-composer-to-git:
- git checkout develop
- git pull
- docker compose up -d api
- docker compose exec --user=1000 api bash -c "XDEBUG_MODE=off composer update --no-scripts"
- git add composer.lock
- git commit -m "updating dependecies"
Expand Down
16 changes: 16 additions & 0 deletions multidomain-tool/src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ public static function createPostgresUserAndDatabase($domain)
pg_prepare($dbconn_db, "", $query);
$result = pg_execute($dbconn_db, "", []);

$queries = [
"GRANT USAGE ON SCHEMA public TO {$username}",
"GRANT ALL ON ALL TABLES IN SCHEMA public TO {$username}",
"GRANT ALL ON ALL ROUTINES IN SCHEMA public TO {$username}",
"GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO {$username}",
"ALTER DEFAULT PRIVILEGES FOR ROLE {$username} IN SCHEMA public GRANT ALL ON TABLES TO {$username}",
"ALTER DEFAULT PRIVILEGES FOR ROLE {$username} IN SCHEMA public GRANT ALL ON ROUTINES TO {$username}",
"ALTER DEFAULT PRIVILEGES FOR ROLE {$username} IN SCHEMA public GRANT ALL ON SEQUENCES TO {$username}",
];

foreach ($queries as $query) {
$query = "GRANT ALL ON SCHEMA public TO {$username}";
pg_prepare($dbconn_db, "", $query);
$result = pg_execute($dbconn_db, "", []);
}

if ($result) {
echo $color->ok("Postgres. GRANT ALL ON SCHEMA public granted to $username on database $username \n");
} else {
Expand Down
Loading