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

Dev #2151

Merged
merged 45 commits into from
Oct 5, 2023
Merged

Dev #2151

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fcf2e71
Merge pull request #1850 from codeeu/1847-add-description-to-approval…
alainvd Sep 22, 2022
332f917
Merge pull request #1851 from codeeu/1847-add-description-to-approval…
alainvd Sep 22, 2022
7d17baa
Merge pull request #1852 from codeeu/1847-add-description-to-approval…
alainvd Sep 22, 2022
954f002
Merge pull request #1857 from codeeu/1845-data-access-api-for-public-…
alainvd Sep 23, 2022
ba10d65
Merge pull request #1866 from codeeu/1793-ukrainian-translations
alainvd Sep 28, 2022
060bf74
Merge pull request #1867 from codeeu/1793-ukrainian-translations
alainvd Sep 28, 2022
1107ab5
Merge pull request #1898 from codeeu/1896-meet-code-issues-with-rss-f…
alainvd Oct 5, 2022
2be50bd
Merge pull request #1907 from codeeu/1906-import-bulgarian-events
alainvd Oct 6, 2022
bdf064f
Merge pull request #1918 from codeeu/1917-import-nl-activities
alainvd Oct 10, 2022
34a3d04
Merge pull request #1920 from codeeu/1917-import-nl-activities
alainvd Oct 10, 2022
1326525
Merge pull request #1922 from codeeu/1885-codeweek-activities-coderdo…
alainvd Oct 11, 2022
d9063d9
Merge pull request #1925 from codeeu/1924-apple-second-batch
alainvd Oct 11, 2022
a1db396
Merge pull request #1958 from codeeu/1951-website-font-compatibility-…
alainvd Oct 25, 2022
24bd984
Merge pull request #1964 from codeeu/1943-bulk-upload-for-uk
alainvd Oct 25, 2022
0453e58
Merge pull request #1967 from codeeu/1943-bulk-upload-for-uk
alainvd Oct 25, 2022
a88b405
Merge pull request #1973 from codeeu/1880-2022-challenges
alainvd Oct 27, 2022
351a190
Merge branch 'master' into dev
alainvd Nov 3, 2022
04c5b5a
Merge pull request #1983 from codeeu/1982-certificates-of-participati…
alainvd Nov 3, 2022
93e3514
Merge pull request #2005 from codeeu/1995-certificate-generation
alainvd Nov 9, 2022
ca3f041
Merge pull request #2009 from codeeu/2008-privacy-statements-translat…
alainvd Nov 10, 2022
c5d4598
devspace for codeweek
raphdom Jan 12, 2023
7f5aed4
Merge pull request #2051 from codeeu/2046-badges-count-for-influence-…
alainvd Feb 23, 2023
d6ab9ce
Merge pull request #2062 from codeeu/2056-security-fixes
alainvd Mar 7, 2023
a0b6af6
Merge pull request #2080 from codeeu/alain
alainvd Mar 17, 2023
56d4538
Merge pull request #2081 from codeeu/alain
alainvd Mar 17, 2023
6f87eed
Merge pull request #2082 from codeeu/alain
alainvd Mar 20, 2023
182faf4
Merge pull request #2083 from codeeu/alain
alainvd Mar 20, 2023
7c2eafa
Merge pull request #2084 from codeeu/alain
alainvd Mar 20, 2023
6f3030b
Merge pull request #2101 from codeeu/master
alainvd Apr 26, 2023
aeaa1f3
Resources Page with tailwind 3 and responsive design
alainvd May 8, 2023
ea67862
Resources Page with tailwind 3 and responsive design
alainvd May 10, 2023
7350dbe
Resources Page with tailwind 3 and responsive design
alainvd May 30, 2023
267d08a
Merge pull request #2107 from codeeu/2105-resources-page
alainvd May 30, 2023
c06411c
Merge pull request #2109 from codeeu/2108-certificates-super-organisers
alainvd Jun 16, 2023
c9a2e18
Merge pull request #2126 from codeeu/2122-create-mooc-page
alainvd Aug 30, 2023
0518291
Merge pull request #2127 from codeeu/2122-create-mooc-page
alainvd Aug 30, 2023
e8a3f57
Merge pull request #2128 from codeeu/2122-create-mooc-page
alainvd Aug 31, 2023
85cf926
Merge pull request #2135 from codeeu/2134-hackathon-landing-page
alainvd Sep 4, 2023
a3e1123
Merge pull request #2136 from codeeu/2134-hackathon-landing-page
alainvd Sep 4, 2023
ff8dc26
Merge pull request #2137 from codeeu/2134-hackathon-landing-page
alainvd Sep 4, 2023
ea38355
Merge pull request #2139 from codeeu/2134-hackathon-landing-page
alainvd Sep 4, 2023
6ce973d
Merge pull request #2142 from codeeu/2141-add-new-mooc
alainvd Sep 7, 2023
93fb734
Merge pull request #2145 from codeeu/2144-import-apple-events
alainvd Sep 29, 2023
2b3037a
Participation certificate 2023
alainvd Oct 5, 2023
7e9a6fc
Merge pull request #2150 from codeeu/2149-update-certificate-of-parti…
alainvd Oct 5, 2023
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
13 changes: 13 additions & 0 deletions app/Http/Controllers/ResourcesPageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ResourcesPageController extends Controller
{
public function index(Request $request)
{
return view('resources-page');
}
}
34 changes: 34 additions & 0 deletions app/View/Components/tailwind/CtaWithImage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App\View\Components\tailwind;

use Illuminate\View\Component;

class CtaWithImage extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(
public string $imagePosition,
public string $title,
public string $content,


)
{

}

/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
return view('components.tailwind.cta-with-image');
}
}
187 changes: 187 additions & 0 deletions devspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
version: v1beta11

vars:
- name: APP_IMAGE
value: public.ecr.aws/cnect-prime/php-8.0-fpm:latest
- name: GITHUB_TOKEN
- name: NOVA_USERNAME
- name: NOVA_PASSWORD

deployments:
- name: nginx-config
kubectl:
manifests:
- devspace/nginx-config-configmap.yaml
- name: codeweek-config
kubectl:
manifests:
- devspace/codeweek.yaml
- name: mysql
helm:
componentChart: false
chart:
name: mysql
version: 9.4.5
repo: https://charts.bitnami.com/bitnami
values:
image:
tag: 8.0.31
resources:
limits:
memory: 2Gi
requests:
cpu: 0.5
memory: 1Gi
auth:
rootPassword: $!{DB_PASSWORD}
database: $!{DB_DATABASE}
username: $!{DB_USERNAME}
password: $!{DB_PASSWORD}
primary:
startupProbe:
enabled: false
initialDelaySeconds: 90
livenessProbe:
enabled: false
readinessProbe:
enabled: false
service:
ports:
mysql: ${DB_PORT}
- name: laravel-app
helm:
componentChart: true
values:
containers:
- name: nginx
image: nginx:alpine
volumeMounts:
- containerPath: /etc/nginx/conf.d
volume:
name: nginx-config
readOnly: true
- containerPath: /assets
volume:
name: shared-files
readOnly: true
- name: php
image: ${APP_IMAGE}
imagePullPolicy: Always
resources:
limits:
memory: 2Gi
requests:
cpu: 0.5
memory: 1Gi
volumeMounts:
- containerPath: /assets
volume:
name: shared-files
readOnly: false
env:
- name: GITHUB_TOKEN
value: ${GITHUB_TOKEN}
- name: NOVA_USERNAME
value: ${NOVA_USERNAME}
- name: NOVA_PASSWORD
value: ${NOVA_PASSWORD}
- name: COMPOSER_ALLOW_SUPERUSER
value: "1"
service:
ports:
- port: 80
volumes:
- name: nginx-config
configMap:
name: nginx-config
- name: shared-files
emptyDir: { }
- name: redis
helm:
componentChart: false
chart:
name: redis
version: 17.4.0
repo: https://charts.bitnami.com/bitnami
values:
image:
tag: 6.0.12
networkPolicy:
enabled: true
allowExternal: true
password: $!{REDIS_PASSWORD}
cluster:
enabled: false
dev:
ports:
- imageSelector: docker.io/bitnami/mysql:8.0.31
forward:
- port: 3308
remotePort: 3306

sync:
- imageSelector: ${APP_IMAGE}
excludePaths:
- .git/
- .git/
- .devspace/
- README.md
uploadExcludePaths:
- Dockerfile
- devspace.yaml
- deploy/
- vendor/
- node_modules/
onUpload:
execRemote:
onBatch:
command: sh
args: [ "-c", "cp -r /var/www/html/public/* /assets/" ]
exec:
- name: npm-install
command: |-
NODE_ENV=development npm install
onChange: [ "./package.json" ]
- name: composer-install
command: |-
composer install --no-interaction
onChange: [ "./composer.json" ]

hooks:
- command: |
composer config -g "http-basic.nova.laravel.com" $NOVA_USERNAME $NOVA_PASSWORD
composer config -g github-oauth.github.com $GITHUB_TOKEN
composer update
php artisan key:generate
chmod -R 777 storage
php artisan vue-i18n:generate
NODE_ENV=development npm install
chown -R www-data:www-data /var/www/html;
npm run dev
container:
imageSelector: ${APP_IMAGE}
events: ["after:initialSync:*"]

commands:
- name: artisan
description: Entry point for artisan commands.
command: devspace enter -c php -- php artisan
appendArgs: true
- name: composer
description: Entry point for composer commands.
command: devspace enter -c php -- composer
appendArgs: true
- name: php
description: Entry point for PHP commands.
command: devspace enter -c php -- php
appendArgs: true
- name: npm
description: Entry point for NPM commands.
command: devspace enter -c php -- npm
appendArgs: true
- name: generate-key
description: Generate APP_KEY.
command: devspace enter -c php -- php artisan key:generate --show
- name: mysql
description: Enter to MySQL shell.
command: devspace enter -c mysql -- mysql -uroot --password=$!{DB_PASSWORD}
36 changes: 36 additions & 0 deletions devspace/.env.devspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
APP_ENV=local
APP_KEY=base64:R7ErAo+lGcenuwxia/CG4raozxe7lYviGc7gHizfUHw=
APP_DEBUG=true
APP_URL=https://codeweek.local.europa.eu
FORCE_HTTPS=true

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_USERNAME=codeweek
DB_PASSWORD=pass123
DB_DATABASE=codeweek

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=redis-master
REDIS_PORT=6379

SCOUT_DRIVER=null
ALGOLIA_APP_ID=
ALGOLIA_KEY=
ALGOLIA_SECRET=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=eu-west-1
AWS_BUCKET=codeweek-dev
AWS_URL=https://codeweek-s3.s3.amazonaws.com/

LOG_CHANNEL=stack

LOCALES=al,ba,bg,cs,da,de,el,en,es,et,fi,fr,hr,hu,it,lt,lv,me,mk,nl,pl,pt,ro,rs,sk,sl,sv

[email protected]
50 changes: 50 additions & 0 deletions devspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Local development with devspace

[DevSpace](https://www.devspace.sh/) is an open-source developer tool for Kubernetes that lets you develop and deploy cloud-native software faster in your own local.

The great advantage of use DevSpace is that you don't need all the tools on your local machine, DevSpace will deploy all the containers inside kubernetes keeping the local code development.

## Pre-Requirements

- [Rancher Desktop](https://rancherdesktop.io/)(recommended) or [Docker desktop](https://www.docker.com/products/docker-desktop/) + [K3d Cluster](https://k3d.io/)
- [Kubectl](https://kubernetes.io/docs/tasks/tools/)
- [DevSpace CLI](https://www.devspace.sh/)

## Codeweek installation

1. In order to run codeweek properly, on your local, you need to have a ssl certificate and simulate a ".europa.eu" domain. For that we need to generate self-signed certificate for your local.
- Follow [this](https://mixable.blog/create-certificate-for-localhost-domains-on-macos/) tutorial to generate self-signed certificates for your localhost
- Create codeweek namespace
```bash
kubectl create ns codeweek
```
- Create the certificate secret on kubernetes
```bash
kubectl create secret generic certificates-secret --from-file=tls.crt=./localhost.crt --from-file=tls.key=./localhost.key
```

2. Add line into the /etc/hosts file
```bash
127.0.0.1 codeweek.local.europa.eu
```

3. Copy .env.devspace file
```bash
cp /devpace/.env.devspace .env
```

4. After this you can go to the codeweek root directory and type:
```bash
devspace dev
```

- Devspace will ask you a token for github and nova credentials
- Wait for devspace starts and setup everything for you

5. Import and create the database
Create empty database
```bash
devspace run artisan artisan migrate:fresh --seed
```

6. Go to https://codeweek.local.europa.eu
40 changes: 40 additions & 0 deletions devspace/codeweek.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: security
namespace: codeweek
spec:
headers:
frameDeny: true
sslRedirect: true
browserXssFilter: true
contentTypeNosniff: true
stsIncludeSubdomains: true
stsPreload: true
addVaryHeader: true
stsSeconds: 31536000
contentSecurityPolicy: upgrade-insecure-requests
customRequestHeaders:
X-Forwarded-Proto: https

---

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: codeweek-ing-route
namespace: codeweek
spec:
entryPoints:
- websecure
routes:
- match: Host(`codeweek.local.europa.eu`)
kind: Rule
services:
- name: laravel-app
port: 80
middlewares:
- name: security
tls:
secretName: certificates-secret

28 changes: 28 additions & 0 deletions devspace/nginx-config-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.conf: |-
server {
listen 80 default_server;
server_name nginx;
root /assets/;

index index.php;
charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
fastcgi_param PHP_VALUE "memory_limit = 2048M";
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
}
Loading
Loading