Skip to content

Commit

Permalink
Merge branch 'develop' into feature/wer-and-cer
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk authored Feb 6, 2025
2 parents dacf752 + 6a90358 commit 4c727ea
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

set_real_ip_from 172.16.0.0/8;
set_real_ip_from 172.16.0.0/16;
real_ip_recursive on;
real_ip_header X-Forwarded-For;

Expand Down
5 changes: 5 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ server {

client_max_body_size ${NGINX_MAX_BODY_SIZE};

# This also needs to be set in the single server tag and not only in http.
set_real_ip_from 172.16.0.0/16;
real_ip_recursive on;
real_ip_header X-Forwarded-For;

location = /favicon.ico {
log_not_found off;
access_log off;
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
push:
tags:
- '*.*.*'

name: Create Github Release

permissions:
contents: write

env:
COMPOSE_USER: runner

jobs:
create-release:
runs-on: ubuntu-latest
env:
COMPOSER_ALLOW_SUPERUSER: 1
APP_ENV: prod
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Composer install
run: |
docker network create frontend
docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative
docker compose run --rm --user=root phpfpm composer clear-cache
- name: Building assets for the frontend
run: |
docker compose run --rm node yarn install
docker compose run --rm node yarn build
- name: Build assets for Giv Din Stemme module
run: |
docker compose run --rm node yarn --cwd web/modules/custom/giv_din_stemme/ install
docker compose run --rm node yarn --cwd web/modules/custom/giv_din_stemme/ build
- name: Clean up
run: |
sudo chown -R runner:runner ./
rm -rf node_modules
rm -rf web/modules/custom/giv_din_stemme/node_modules
- name: Make assets dir
run: |
mkdir -p ../assets
- name: Create archive
run: |
tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./
- name: Create checksum
run: |
cd ../assets
sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt
- name: Create a release in GitHub and uploads assets
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.*
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
6 changes: 5 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
on: pull_request

name: Review

env:
COMPOSE_USER: runner

jobs:
changelog:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -28,7 +32,7 @@ jobs:

- name: Coding standards
run: |
docker run --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md)
docker run --rm --volume "$PWD:/md" itkdev/markdownlint $(git ls-files *.md)
composer-normalize:
name: composer-normalize
Expand Down
41 changes: 41 additions & 0 deletions .woodpecker/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
when:
- event: release

skip_clone: true

steps:
- name: Ansible playbook
image: itkdev/ansible-plugin:1
pull: true
settings:
id:
from_secret: id
secret:
from_secret: secret
host:
from_secret: host
path:
from_secret: path
user:
from_secret: user
playbook: 'release'
pre_up:
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes cache:rebuild
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes deploy
# Fixes issue with 'Drupal\mysql\Driver\Database\mysql\Connection' not found
- itkdev-docker-compose-server run --rm phpfpm composer2 dump-autoload
cron:
cron:
minute: '*/5'
hour: '*'
day: '*'
month: '*'
weekday: '*'
job: 'itkdev-docker-compose-server exec phpfpm vendor/bin/drush --yes core:cron'
# whisper:
# minute: '0'
# hour: '3'
# day: '*'
# month: '*'
# weekday: '*'
# job: 'itkdev-docker-compose-server exec phpfpm vendor/bin/drush --yes giv-din-stemme:qualify:all'
33 changes: 33 additions & 0 deletions .woodpecker/stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
when:
- branch: release/*
event: push

skip_clone: true

steps:
- name: Run test site update
image: itkdev/ansible-plugin:1
when:
branch: release/*
event: push
pull: true
settings:
id:
from_secret: id
secret:
from_secret: secret
host:
from_secret: stg_host
path:
from_secret: stg_path
user:
from_secret: user
actions:
- git reset --hard
- git fetch origin ${CI_COMMIT_BRANCH}
- git checkout ${CI_COMMIT_BRANCH}
- git pull
- itkdev-docker-compose-server up -d --force-recreate
- itkdev-docker-compose-server exec phpfpm composer install
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes cache:rebuild
- itkdev-docker-compose-server run --rm phpfpm vendor/bin/drush --yes deploy
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See [keep a changelog] for information about writing changes to this log.
* Modifies qualify command to only transcribe donations.
* Makes commands calculating each of the metrics (WER, CER and similar_text)

## [1.0.0] 2024-11-29
## [1.0.0] - 2024-11-29

* [PR-55](https://github.com/itk-dev/giv-din-stemme/pull/55)
* Added Architectural decision record (ADR)
Expand Down Expand Up @@ -46,7 +46,7 @@ See [keep a changelog] for information about writing changes to this log.
* [PR-41](https://github.com/itk-dev/giv-din-stemme/pull/41)
Toggle button icon change
* [PR-21](https://github.com/itk-dev/giv-din-stemme/pull/21)
Added web accessiblity statement
Added web accessibility statement
* [PR-38](https://github.com/itk-dev/giv-din-stemme/pull/38)
Added file data to metadata.
* [PR-35](https://github.com/itk-dev/giv-din-stemme/pull/35)
Expand Down Expand Up @@ -83,6 +83,6 @@ See [keep a changelog] for information about writing changes to this log.
Mobile optimization.
* Initial project.


[Unreleased]: https://github.com/itk-dev/doner-din-stemme/compare/1.0.0...HEAD
[1.0.0]: https://github.com/itk-dev/doner-din-stemme/releases/tag/1.0.0
[keep a changelog]: https://keepachangelog.com/en/1.1.0/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ docker compose run --rm phpfpm composer coding-standards-check/twig-cs-fixer
```

```shell name=coding-standards-markdown
docker run --platform linux/amd64 --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md) --fix
docker run --platform linux/amd64 --rm --volume "$PWD:/md" peterdavehello/markdownlint markdownlint $(git ls-files *.md)
docker run --rm --volume "$PWD:/md" itkdev/markdownlint $(git ls-files *.md) --fix
docker run --rm --volume "$PWD:/md" itkdev/markdownlint $(git ls-files *.md)
```

```shell name="coding-standards-assets"
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.server.oidc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
ASPNETCORE_URLS: https://+:443;http://+:80
ASPNETCORE_Kestrel__Certificates__Default__Password: mock
ASPNETCORE_Kestrel__Certificates__Default__Path: /tmp/config/.docker/oidc-server-mock/cert/docker.pfx

ASPNETCORE_ENVIRONMENT: Development
SERVER_OPTIONS_INLINE: |
AccessTokenJwtType: JWT
Expand All @@ -37,17 +36,14 @@ services:
Authentication:
CookieSameSiteMode: Lax
CheckSessionCookieSameSiteMode: Lax
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
CLIENTS_CONFIGURATION_INLINE: |
- ClientId: client-id
ClientSecrets: [client-secret]
Expand All @@ -73,7 +69,6 @@ services:
- '*'
# https://github.com/Soluto/oidc-server-mock/issues/46#issuecomment-704845375
RequirePkce: false
# Needed to set custom claim types in "profile"
# https://github.com/Soluto/oidc-server-mock/issues/123#issuecomment-1427129278
# https://github.com/Soluto/oidc-server-mock/blob/master/README.md#simple-configuration
Expand All @@ -94,7 +89,6 @@ services:
- name
- zip
- uuid
USERS_CONFIGURATION_INLINE: |
- SubjectId: 1
Username: citizen1
Expand Down
6 changes: 1 addition & 5 deletions docker-compose.server.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ services:
phpfpm:
environment:
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
- PHP_PM_TYPE=static
- PHP_PM_MAX_CHILDREN=24
- PHP_PM_MAX_REQUESTS=10000
- PHP_POST_MAX_SIZE=18M
- PHP_UPLOAD_MAX_FILESIZE=15M
- PHP_POST_MAX_SIZE=18M
- PHP_UPLOAD_MAX_FILESIZE=15M

nginx:
environment:
- NGINX_MAX_BODY_SIZE=20M
10 changes: 10 additions & 0 deletions docker-compose.server.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
phpfpm:
volumes:
- ../../shared/settings.local.php:/app/web/sites/default/settings.local.php
- ../../shared/files:/app/web/sites/default/files
- ../../shared/private:/app/private

nginx:
volumes:
- ../../shared/files:/app/web/sites/default/files
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:

phpfpm:
image: itkdev/php8.3-fpm:latest
user: ${COMPOSE_USER:-deploy}
networks:
- app
extra_hosts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ access giv din stemme:
title: 'Access giv din stemme'
description: 'Access to giv din stemme routes'


view giv din stemme entity:
title: 'View giv din stemme entity'
description: 'View access to giv din stemme entity'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ giv_din_stemme.test:
_controller: '\Drupal\giv_din_stemme\Controller\GivDinStemmeController::test'
_title: 'Test'
requirements:
_permission: 'access content'
_permission: 'access giv din stemme'
options:
# The content depends on the browser user agent, so we disable caching.
no_cache: TRUE
Expand Down

0 comments on commit 4c727ea

Please sign in to comment.