Skip to content

Commit

Permalink
Merge pull request #1564 from AgID/develop
Browse files Browse the repository at this point in the history
Consolidation in master
  • Loading branch information
pdavide authored Oct 13, 2022
2 parents e88a1d2 + 4878bb2 commit 3a4ff84
Show file tree
Hide file tree
Showing 19 changed files with 1,346 additions and 1,035 deletions.
17 changes: 5 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
version: 2.1

commands:
install_system_dependencies:
description: Install dependencies needed for the tests to run
steps:
- run:
name: Install pcntl php extension
command: sudo docker-php-ext-install pcntl

restore_all_caches:
description: Restore php and javascript dependencies
steps:
Expand Down Expand Up @@ -60,8 +53,8 @@ commands:
name: Run security-checker
command: |
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv /home/circleci/.symfony/bin/symfony /usr/local/bin/symfony
# symfony check:security
sudo mv /home/circleci/.symfony5/bin/symfony /usr/local/bin/symfony
symfony check:security
install_node_packages:
description: Ensure all javascript dependencies are installed
Expand Down Expand Up @@ -122,11 +115,10 @@ commands:
jobs:
build_and_test:
docker:
- image: circleci/php:7.4.12-cli
- image: cimg/php:7.4
environment:
APP_ENV: "testing"
steps:
- install_system_dependencies
- checkout
- restore_all_caches
- composer
Expand All @@ -135,7 +127,8 @@ jobs:
- security
- install_node_packages
- save_all_caches
- setup_remote_docker
- setup_remote_docker:
version: 20.10.12
# build
- run:
name: Run build task
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/WebsiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function custom()
*/
public function storePrimary(StorePrimaryWebsiteRequest $request): RedirectResponse
{
if (config('wai.disable_new_websites')) {
if (config('wai.app_suspended')) {
return redirect()->route('websites.index');
}

Expand Down Expand Up @@ -171,7 +171,7 @@ public function create(PublicAdministration $publicAdministration): View
*/
public function store(StoreWebsiteRequest $request, PublicAdministration $publicAdministration): RedirectResponse
{
if (config('wai.disable_new_websites')) {
if (config('wai.app_suspended')) {
return redirect()->route('websites.index')->withModal([
'title' => __('Il sito non è stato inserito'),
'message' => __('Al momento non è possibile aggiungere nuovi siti web a :app.', ['app' => config('app.name')]),
Expand Down Expand Up @@ -201,7 +201,7 @@ public function store(StoreWebsiteRequest $request, PublicAdministration $public
*/
public function storeApi(StoreWebsiteRequest $request): JsonResponse
{
if (config('wai.disable_new_websites')) {
if (config('wai.app_suspended')) {
return $this->errorResponse('Creation of websites is temporarily disabled', $this->getErrorCode(Website::class), 503);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Traits/HasAnalyticsDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function addToRollUp(Website $website): void
protected function registerAccount(AnalyticsService $analyticsService): void
{
$hashedAnalyticsPassword = md5(Str::random(rand(32, 48)) . config('app.salt'));
$analyticsService->registerUser($this->ipa_code, $hashedAnalyticsPassword, Str::slug($this->ipa_code) . '@' . 'webanalyticsitalia.local');
$analyticsService->registerUser($this->ipa_code, $hashedAnalyticsPassword, Str::slug($this->ipa_code) . '@webanalyticsitalia.local');
$this->token_auth = $analyticsService->getUserAuthToken($this->ipa_code, md5($hashedAnalyticsPassword));
$this->save();
}
Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<token key="LOG_SLACK_WEBHOOK_URL_EXTRA_CHANNEL" value="${LOG_SLACK_WEBHOOK_URL_EXTRA_CHANNEL}" />
<token key="LOG_SLACK_USERNAME_EXTRA_CHANNEL" value="${LOG_SLACK_USERNAME_EXTRA_CHANNEL}" />
<token key="APP_CLOSED_BETA_ENABLED" value="${APP_CLOSED_BETA_ENABLED}" />
<token key="APP_DISABLE_NEW_WEBSITES" value="${APP_DISABLE_NEW_WEBSITES}" />
<token key="APP_SUSPENDED" value="${APP_SUSPENDED}" />
<token key="APP_CUSTOM_PUBLIC_ADMINISTRATIONS_ENABLED" value="${APP_CUSTOM_PUBLIC_ADMINISTRATIONS_ENABLED}" />
<token key="APP_API_VERSION" value="${APP_API_VERSION}" />
<token key="APP_SUPER_ADMIN_NAME" value="${APP_SUPER_ADMIN_NAME}" />
Expand Down Expand Up @@ -386,7 +386,7 @@
</if>
<!-- Set files ownership -->
<echo msg="Setting files ownership..."/>
<exec command="docker-compose exec php-fpm chown -R www-data:www-data storage database .env" dir="containers" checkreturn="true"/>
<exec command="docker-compose exec php-fpm chown -R www-data:www-data /var/www/html" dir="containers" checkreturn="true"/>
<exec command="docker-compose exec php-fpm chown -R www-data:www-data /opt/matomo" dir="containers" checkreturn="true"/>
<exec command="docker-compose exec php-fpm chown -R www-data:www-data /var/log/php" dir="containers" checkreturn="true"/>
<exec command="docker-compose exec php-fpm chown -R www-data:www-data /var/log/matomo" dir="containers" checkreturn="true"/>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "italia/wai-portal",
"description": "Web Analytics Italia",
"version": "2.7.1-beta",
"version": "2.7.2-beta",
"keywords": ["analytics", "italia"],
"license": "AGPL-3.0-or-later",
"type": "project",
Expand Down
Loading

0 comments on commit 3a4ff84

Please sign in to comment.