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

Symfony 4 upgrade #562

Closed
wants to merge 7 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
130 changes: 130 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=e1023e5989bec76e282bd0ee405200e0
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/db_name?serverVersion=8"
DATABASE_URL="mysql://spdrw:secret@db.vm.openconext.org/spdashboard?serverVersion=14&charset=utf8"
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
MAILER_DSN=null://null
###< symfony/swiftmailer-bundle ###

locale=en
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking at this .env.dist file as a replacement for the parameters.yaml.dist file. From that perspective:

  • I'd love to see all comments that where previously there, instructing a user on how to fill the parameters.
  • While at it, please group related parameters (like they where in parameters.yaml.dist) and hence improve readability of this file.

mailer_transport=smtp
mailer_host=127.0.0.1
mailer_user=null
mailer_password=null

# A secret key that's used to generate certain security-related tokens
secret=ThisTokenIsNotSoSecretChangeIt

session_max_absolute_lifetime=3600
session_max_relative_lifetime=600

logout_redirect_url='https=//www.surf.nl/over-surf/werkmaatschappijen/surfnet'

# All users in these teams get the administrator role
administrator_teams="'urn:collab:org:surf.nl','urn:collab:org:vm.openconext.org','urn:collab:org:dev.support.surfconext.nl'"

saml_sp_publickey='%kernel.project_dir%//vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
saml_sp_privatekey='%kernel.project_dir%//vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_privatekey.pem'
saml_metadata_publickey='%kernel.project_dir%//vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
saml_metadata_privatekey='%kernel.project_dir%//vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_privatekey.pem'
saml_remote_idp_entity_id='https://engine.vm.openconext.org/authentication/idp/metadata'
saml_remote_idp_host=engine.vm.openconext.org
saml_remote_idp_sso_url='https://engine.vm.openconext.org/authentication/idp/single-sign-on'
saml_remote_idp_certificate=MIIDuDCCAqCgAwIBAgIJAPdqJ9JQKN6vMA0GCSqGSIb3DQEBBQUAMEYxDzANBgNVBAMTBkVuZ2luZTERMA8GA1UECxMIU2VydmljZXMxEzARBgNVBAoTCk9wZW5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6wI6gPCGh/q1qv2HnngmnPrNzZik8XucGcf1Wm2zE4UIVYKW31T52mqRVDKRk8F3Eo=

# The default timeout for Curl requests when retrieving metadata
metadata_url_timeout=30

# Manage defaults

## Manage test instance
manage_test_host='https://manage.vm.openconext.org'
manage_test_username=sp-dashboard
manage_test_password=secret
manage_test_publication_status=testaccepted

## Manage production instance
manage_prod_host='https://manage.vm.openconext.org'
manage_prod_username=sp-dashboard
manage_prod_password=secret
manage_prod_publication_status=prodaccepted

## Teams test instance
teams_host='https://teams.vm.openconext.org'
teams_username=spdashboard
teams_password=secret

# Mail default settings
mail_from=support@surfconext.nl
mail_receiver=support@surfconext.nl
mail_no_reply=no-reply@surfconext.nl

# Jira settings
jira_host='https://jira.example.com'
jira_username=sp-dashboard
jira_password=secret
surfnet_dashboard_repository_issue=DevelopmentIssueRepository

# By enabling 'jira_enable_test_mode', no real Jira backend is required to still simulate the Jira integration
#jira_enable_test_mode=true

# When 'jira_enable_test_mode' is enabled, 'jira_test_mode_storage_path' must be configured with a filename in a directory that is writable for the user run ning the application.
jira_test_mode_storage_path=../var/issues.json

# Jira default issue settings
jira_issue_priority=Medium
jira_issue_type=spd-delete-production-entity
jira_issue_type_publication_request=spd-request-production-entity
jira_issue_type_entity_change_request=spd-request-change-request-prod
jira_issue_entityid_fieldname=customfield_13018

# The label that is set for the manage id field, used to compose the JQL which identifies a custom field by its label
jira_issue_manageid_fieldname=customfield_13401
jira_issue_reporter_fieldname=customfield_99999
jira_issue_manageid_field_label='Manage entity ID'
jira_issue_project_key=CXT

# Playground uri's for OIDC entities
playground_uri_test='https://test.dev.playground.surfconext.nl'
playground_uri_prod='https://prod.dev.playground.surfconext.nl'

## Toggle display & content of global site notice. Use a date to ensure that multiple notification in short order do not interfere with each other (aka: th e user can close the first, and still see the second).
global_site_notice_show=false
global_site_notice_date='11.05.2021'
global_site_notice_allowed_tags='<a><u><i><br><wbr><strong><em><blink><marquee><p><ul><ol><dl><li><dd><dt><div><span><blockquote><hr><h2></h2><h3><h4><h5><h6>'

# Teams urn prefix, see: https://www.pivotaltracker.com/story/show/179572218/comments/227653860
team_prefix_default_stem_name='urn:collab:group:vm.openconext.org:'
team_prefix_group_name_context='demo:openconext:org:'
7 changes: 7 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# define your env variables for the test env here
KERNEL_CLASS='Surfnet\ServiceProviderDashboard\Kernel'
APP_ENV=test
APP_DEBUG=false
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
DATABASE_URL="sqlite:////tmp/spdashboard-webtests.sqlite"
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:

Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:

Expand Down Expand Up @@ -52,19 +52,15 @@ jobs:

- name: Make the log and cache dir writable
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm chmod 777 /var/www/html/var/{logs,cache}
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm chmod 777 /var/www/html/var/cache

- name: Copy parameters.yml.dist to parameters.yml
- name: Copy .env.dist to .env
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm cp /var/www/html/app/config/parameters.yml.dist /var/www/html/app/config/parameters.yml
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm cp /var/www/html/.env.dist /var/www/html/.env

- name: Wait until the spdashboard is accessable
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T openconext sh /usr/local/sbin/spdup.sh

- name: Disable Symfony debug mode
run: |
docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T php-fpm sed -i s/\'dev\',\ true/\'dev\',\ false/g /var/www/html/web/app_dev.php

- name: Run cypress tests
run: docker-compose -f docker-compose.yml -f docker-compose-ci.yml exec -T cypress cypress run --browser chrome
Expand Down
31 changes: 26 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/.vagrant/
/ansible/*.retry
/app/config/parameters.yml
docker-compose.override.yml
app/js/coverage
assets/js/coverage
/build/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/build/ stil in action? I thougth encore drops the web assets in the public/build folder.

/var/*
!/var/cache
Expand All @@ -16,8 +15,30 @@ app/js/coverage
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
/.idea
/node_modules
/web/build
/web/coverage
/.env
###> symfony 4 ###
/public/build/
###< symfony 4 ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ before_install:

before_script:
- phpenv config-add travis.php.ini
- composer self-update --1
- composer install --no-interaction
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/spdashboard/tasks/install-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- name: Delete config
file: path={{spdashboard_data_dir}}/current/app/{{ item }} state=absent
with_items:
- config/parameters.yml
- config/parameters.yaml
Comment on lines 40 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a thing anymore right? If we need to remove some distributed configuration it should be a .env file we are removing here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quartje as you've been informed of. We are walking away from parameters.yaml configuration. And started using the .env way instead. May I ask you to review the changes (or missing changes) to the deployment code (ansible + github actions)? I will try to do so as well, but your Docker evengalist eagle eye will probably spot a thing or two 🦜


- name: Delete cache, log and sessions
file: path={{spdashboard_data_dir}}/current/var/{{ item }} state=absent
Expand All @@ -57,7 +57,7 @@
- cache

- name: Install config file
template: src=parameters.yml.j2 dest={{ spdashboard_data_dir}}/current/app/config/parameters.yml
template: src=parameters.yaml.j2 dest={{ spdashboard_data_dir}}/current/app/config/parameters.yaml
Comment on lines 59 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?


- name: Clear the cache
command: php72 bin/console cache:clear --env=prod
Expand Down
7 changes: 0 additions & 7 deletions app/AppCache.php

This file was deleted.

69 changes: 0 additions & 69 deletions app/AppKernel.php

This file was deleted.

11 changes: 0 additions & 11 deletions app/autoload.php

This file was deleted.

Loading