Skip to content
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
8 changes: 0 additions & 8 deletions celements-admin-frontend/.env.dev

This file was deleted.

1 change: 1 addition & 0 deletions celements-admin-frontend/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_CEL_API_URL=http://localhost:2080
13 changes: 0 additions & 13 deletions celements-admin-frontend/.env.prod

This file was deleted.

9 changes: 3 additions & 6 deletions celements-admin-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ npm install

### Configuration

For local development, copy the browser configuration and adjust it for your environment:
For local development, copy the browser and Vite proxy configurations and adjust them for your environment:

```sh
cp public/config.sample.js public/config.js
cp .env.local.sample .env.local
```

The container generates `config.js` from its runtime environment. The local Vite dev server uses `.env.dev` for its API proxy:

```sh
VITE_CEL_API_URL=http://...
```
The container generates `config.js` from its runtime environment. `.env.local` is used only by the local Vite dev server to configure its API proxy.

---

Expand Down
2 changes: 1 addition & 1 deletion celements-admin-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "concurrently \"vite --mode dev\" \"npm:type-check-watch\" \"npm:test-watch\"",
"dev": "concurrently \"vite\" \"npm:type-check-watch\" \"npm:test-watch\"",
"build": "npm run type-check && npm run test && vite build",
"preview": "vite preview",
"test": "vitest run",
Expand Down
2 changes: 1 addition & 1 deletion celements-webapp/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DB_HOST_PORT=2306
# database
DB_DRIVER=com.mysql.jdbc.Driver
DB_SCHEME=jdbc:mysql
DB_HOST=celements-db
DB_HOST=db
DB_PORT=3306
DB_USER=celements
DB_PASSWORD=celements
Expand Down
4 changes: 4 additions & 0 deletions celements-webapp/.env.tomcat
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# spring
SPRING_PROFILES_ACTIVE=${PROFILE:-local}

# xwiki
xwiki_db=${DB_MAIN}
xwiki_db_prefix=${DB_PREFIX}_
xwiki_url_port=${TOMCAT_PORT}

# hibernate
hibernate_connection_url=${DB_SCHEME}://${DB_HOST}:${DB_PORT}/${DB_PREFIX}_${DB_MAIN}?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''&usePipelineAuth=false&disablePipeline=true
Expand Down
14 changes: 7 additions & 7 deletions celements-webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

## Local Development

Log in to GHCR once so Docker can pull shared images Use your GitHub username and a classic token
(https://github.com/settings/tokens) with `read:packages` scope as the password.
Log in to the forge once so Docker can pull shared images. Generate an access token
(https://forge.celhosting.ch/user/settings/applications) with `package: Read` permission.

```sh
docker login ghcr.io
docker login forge.celhosting.ch
```


Expand All @@ -26,10 +26,10 @@ Build the exploded WAR for the local mounted-webapp setup:
mvn clean install
```

Start the sqlserver first, then the rest:
Start the database first, then the rest:

```sh
docker compose up -d sqlserver
docker compose up -d db
docker compose up -d
```

Expand Down Expand Up @@ -59,5 +59,5 @@ The image is published by `Jenkinsfile.image`.

The pipeline extracts the Maven project version from `pom.xml` and publishes:

- `ghcr.io/celements/celements-webapp:<version>`
- `ghcr.io/celements/celements-webapp:<version>-<git-sha>`
- `forge.celhosting.ch/celements/celements-webapp:<version>`
- `forge.celhosting.ch/celements/celements-webapp:<version>-<git-sha>`
34 changes: 13 additions & 21 deletions celements-webapp/compose.local.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,39 @@
name: celements-web
name: ${APP_NAME}
Comment thread
msladek marked this conversation as resolved.
services:

webserver:
container_name: celements-web
image: ghcr.io/synventis-infra/tomcat:release
web:
image: forge.celhosting.ch/synventis-infra/tomcat:release
ports:
- "${TOMCAT_PORT:-2080}:8080" # tomcat
- "${JPDA_PORT:-2000}:8000" # remote debugging
- "127.0.0.1:${TOMCAT_PORT:-2080}:8080" # tomcat
- "127.0.0.1:${JPDA_PORT:-2000}:8000" # remote debugging
env_file:
- .env
- .env.tomcat
volumes:
- ./target/celements-web:/usr/local/tomcat/webapps/ROOT:ro
- web-data:${APP_DATA}:rw
- ./target/${APP_NAME}-web:/usr/local/tomcat/webapps/ROOT:ro
- ./docker/tomcat/log4j2.properties:/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/log4j2.properties:ro
restart: unless-stopped
networks:
- celements
logging:
driver: journald
depends_on:
- sqlserver
- db

sqlserver:
container_name: celements-db
db:
image: mariadb:10.1
ports:
- "${DB_HOST_PORT:-2306}:3306" # for direct client access
- "127.0.0.1:${DB_HOST_PORT:-2306}:3306" # for direct client access
env_file: .env
environment:
- "MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:?}"
volumes:
- db-data:/var/lib/mysql
- ./docker/sqlserver/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ./docker/sqlserver/init:/docker-entrypoint-initdb.d:ro
- ./docker/mariadb/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ./docker/mariadb/init:/docker-entrypoint-initdb.d:ro
restart: unless-stopped
networks:
- celements
logging:
driver: journald

volumes:
web-data:
db-data:

networks:
celements:
driver: bridge
2 changes: 1 addition & 1 deletion celements-webapp/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN --mount=type=secret,id=mvnsettings,required=true,target=/root/.m2/settings.x
-Dmaven.repo.local=/root/.m2/repository \
clean prepare-package war:exploded

FROM ghcr.io/synventis-infra/tomcat:release AS execute
FROM forge.celhosting.ch/synventis-infra/tomcat:release AS execute

ARG VERSION
ARG REVISION
Expand Down
1 change: 0 additions & 1 deletion celements-webapp/docker/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
.vscode
compose.local.yml
compose.build.yml
docker/sqlserver
node_modules
target
3 changes: 3 additions & 0 deletions celements-webapp/docker/tomcat/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ appender.console.layout.pattern=%d{ISO8601} [%t] %-5p %-30.30c{2} - %m %n
rootLogger.level=warn
rootLogger.appenderRef.stdout.ref=STDOUT

logger.springEnv.name=org.springframework.web.context.support.StandardServletEnvironment
logger.springEnv.level=debug

logger.init.name=com.celements.init
logger.init.level=info

Expand Down
3 changes: 2 additions & 1 deletion celements-webapp/src/main/webapp/WEB-INF/xwiki.properties
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ core.defaultDocumentSyntax = xwiki/1.0
#-# velocity.properties = velocimacro.permissions.allow.inline.local.scope = true
#-# velocity.properties = runtime.introspector.uberspect = org.xwiki.velocity.introspection.ChainingUberspector
#-# velocity.properties = runtime.introspector.uberspect.chainClasses = org.apache.velocity.util.introspection.SecureUberspector,org.xwiki.velocity.introspection.DeprecatedCheckUberspector
#-# Securitiy Fix !!!
velocity.properties = input.encoding = UTF-8
#-# Security fix: restricts #parse and #include resources to /templates/
velocity.properties = eventhandler.include.class = com.celements.web.XWikiIncludeEventHandler
#-# fix max depth for macro recursions. Celements needs more than the default 10
velocity.properties = velocimacro.depth.max = 100
Expand Down