Skip to content

Commit 83a0a3d

Browse files
authored
Merge branch 'master' into PHRAS-4155_4.1.19_release
2 parents 4262341 + 9f80391 commit 83a0a3d

File tree

10 files changed

+204
-80
lines changed

10 files changed

+204
-80
lines changed

.dockerignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/env.*
99
/.git
1010
/.gitignore
11+
/.github
1112
/.travis.yml
1213
/AUTHORS
1314
/CONTRIBUTORS
@@ -38,4 +39,8 @@
3839
/www/thumbnails
3940
/www/.htaccess
4041
npm-debug.log
41-
stack_management.sh
42+
stack.sh
43+
/.vagrant
44+
/Vagrantfile
45+
46+

.env

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#
4343
# - "docker-compose.limits.yml" : defines containers cpu and memory limits for all Phraseanet and gateway containers only.
4444
#
45-
# - "docker-compose.altenatives.yml": all alternative services, used only on evoluation or transition periods
45+
# - "docker-compose.alternatives.yml": all alternative services, used only on evolution or transition or testing periods
4646
#
4747
# 2/ "COMPOSE_PROFILES" value define which profiles you want to use
4848
# in docker-compose.
@@ -60,8 +60,9 @@
6060
# choose to launch only some workers, see worker profile list below.
6161
# - "worker" : launch one container worker with all jobs run on it.
6262
# - "cmd" : launch a container based on worker image, useful for run cmd manualy.
63-
# - "db" : db profile will launch a mariadb container,
63+
# - "db" : db profile will launch a mariadb container, with data stored on host and mounted in the db container.
6464
# because this is the primary datastore, you should use you own SGDD service for production needs.
65+
# - "db-docker-vol" : same as "db" profile but with data stored in a docker volume.
6566
# - "elastisearch" : launch a elasticsearch container.
6667
# - "rabbitmq" : launch a rabbitmq container.
6768
# - "redis" : launch a redis container for app cache.
@@ -72,7 +73,7 @@
7273
# - "mailhog" : for catching all email emit by app for dev and testing.
7374
# - "db-backup" : launch and run a container to cron database backups and backup file's rotation.
7475
# - "pma" : launch a phpmyadmin container for test and dev purpose.
75-
# - "mysql8" : launch a mysql8 container (beta), (/!\ do not mix with the "db" profile)
76+
# - "db-mysql8" : launch a mysql8 container (beta), (/!\ do not mix with the "db" profile)
7677
# Because this is the primary datastore, you should use you own SGDD service for production needs.
7778
#
7879
# Profiles worker list:
@@ -257,7 +258,7 @@ PHRASEANET_MAINTENANCE=0
257258
# Example :
258259
# PHRASEANET_MAINTENANCE_MESSAGE="<p>Under&#32;maintenance!</p><p>More&#32;information&#32;<a href=\"https://www.yoururl.fr\">here</a></p>"
259260
# @run
260-
PHRASEANET_MAINTENANCE_MESSAGE=
261+
PHRASEANET_MAINTENANCE_MESSAGE="Site: $PHRASEANET_PROJECT_NAME are under Maintenance ! Sorry, come back Later"
261262

262263
# --- RabbitMQ settings ------------------------------------------------------------------------------------------------
263264

@@ -279,7 +280,7 @@ RABBITMQ_MANAGEMENT_PORT=10811
279280
RABBITMQ_HOSTNAME=rabbit_phraseanet
280281

281282
# @run
282-
RABBITMQ_IMAGE_VERSION=rabbitmq:4.1.0-management
283+
RABBITMQ_IMAGE_TAG=rabbitmq:4.1.0-management
283284

284285
# --- Gateway settings (Nginx) -----------------------------------------------------------------------------------------
285286

@@ -580,6 +581,17 @@ DB_BACKUP_CRON_TIME=
580581
# @run
581582
DB_BACKUP_GZIP_LEVEL=9
582583

584+
# --- redis cache settings ---------------------------------------------------------------------------------------------
585+
586+
# Redis session Image Tag.
587+
# @run
588+
REDIS_CACHE_IMAGE_TAG=redis:8.0.1
589+
590+
# --- redis session settings ---------------------------------------------------------------------------------------------
591+
592+
# Redis cache Image Tag.
593+
# @run
594+
REDIS_SESSION_IMAGE_TAG=redis:8.0.1
583595

584596
# --- Pusher Settings ---
585597
# Phraseanet use the Pusher service to notify users of asynchronous downloads https://pusher.com.

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Get official support : https://www.alchemy.fr/en/rubrique/services/
9797
## Prerequisites
9898

9999

100-
- docker >=25.0.5
101-
- docker compose >= 2.29.0
100+
- docker >=27.3.1
101+
- docker compose >= 2.30.3
102102

103103
In the stack Docker, Docker Compose included in this repo starts by default in test mode.
104104
All services are launched in a separate container and except "Phraseanet app" and "workers" containers,
@@ -186,7 +186,7 @@ COMPOSE_PROFILES=app,gateway-classic,db,pma,elasticsearch,redis,redis-session,ra
186186

187187

188188
You should review the default env variables defined in `.env` file.
189-
Use `export` method to override these values
189+
Use `export` method to override these values
190190

191191
i.e:
192192
```bash
@@ -198,24 +198,26 @@ export PHRASEANET_APP_PORT=8082
198198

199199
If you want persit this change you can also save your change in a files named `env.local` or `.env.local`
200200

201-
These files are git ignored and permit stack customization without git conflict generation.
201+
These files are git ignored and permit stack customization without git conflict.
202202

203203
If you are not interested in the development of Phraseanet, you can ignore everything in `.env` after the `DEV Purpose` part.
204204

205205

206206
### stack Management
207207

208-
To start and stop the stack, use the `stack_management.sh start|stop|info|check|log` script at the project root.
208+
209+
To start and stop the stack, use the `stack_management.sh start|stop|info|status|log` script at the project root.
209210
this script work only Linux and MacOS.
210211

211212
This script wrapping standard oprations for the stack, using standard docker compose cmd and take in account `.env` and `env.local | .env.local` files.
212213

214+
213215
The `stop` operation is the most critical function of the script, as it ensures a clean shutdown
214216
of the database container before stopping the entire stack.
215217

216218
This script is useful if you are using the database container within the stack.
217219

218-
see more here ![stack Management](doc/infra/compose/stack_management.md)
220+
see more here ![stack](doc/infra/compose/stack.md)
219221

220222
### Using a env.local method for custom .env values
221223

doc/infra/compose/stack_management.md renamed to doc/infra/compose/stack.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This script is an helper designed to manage a Phraseanet Docker compose stack by
1212
- **Version Checking**: Verify the compatibility of Docker and Docker Compose versions.
1313
- **Environment Information**: Gather detailed information about the environment, including Phraseanet installation status, version details, and internal URLs.
1414
- **Log Viewing**: View logs for all containers or filter logs for a specific container.
15-
- **Environment Variables**: Load and display environment variables from `.env` and either `env.local` or `.env.local` files.
15+
1616

1717
## Usage
1818

@@ -26,32 +26,32 @@ This script is an helper designed to manage a Phraseanet Docker compose stack by
2626

2727
- **Start the Stack**:
2828
```bash
29-
./manage_docker.sh start
29+
./stack.sh start
3030
```
3131

3232
- **Stop the Stack**:
3333
```bash
34-
./manage_docker.sh stop
34+
./stack.sh stop
3535
```
3636

3737
- **Check Versions**:
3838
```bash
39-
./manage_docker.sh check
39+
./stack.sh status
4040
```
4141

4242
- **Display Environment Information**:
4343
```bash
44-
./manage_docker.sh info
44+
./stack.sh info
4545
```
4646

4747
- **View Logs**:
4848
- For all containers:
4949
```bash
50-
./manage_docker.sh log
50+
./stack.sh logs
5151
```
5252
- For a specific container:
5353
```bash
54-
./manage_docker.sh log <container_name>
54+
./stack.sh logs <container_name>
5555
```
5656

5757
### Environment Variables

docker-compose.altenatives.yml renamed to docker-compose.alternatives.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
services:
2-
3-
db:
2+
db-mysql8:
43
image: mysql:8.0.36-debian
54
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
65
# (this is just an example, not intended to be a production configuration)
76
command: --default-authentication-plugin=mysql_native_password --max_allowed_packet=$MYSQL_MAX_ALLOWED_PACKET --max_connections=$MYSQL_MAX_CONNECTION --long_query_time=$MYSQL_LONG_QUERY_TIME --sql_mode="NO_ENGINE_SUBSTITUTION"
87
restart: on-failure
9-
profiles: ["mysql8"]
8+
profiles: ["db-mysql8"]
109
entrypoint:
11-
sh -c "
10+
sh -c \"
1211
echo 'CREATE DATABASE IF NOT EXISTS ab_master CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_databox1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_unitTest CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_dataset1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE DATABASE IF NOT EXISTS db_dataset2 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER `$PHRASEANET_DB_USER`@`%` IDENTIFIED BY \"$PHRASEANET_DB_PASSWORD\";GRANT ALL PRIVILEGES ON *.* to `$PHRASEANET_DB_USER`@`%`;' > /docker-entrypoint-initdb.d/init.sql;
1312
chmod +x /usr/local/bin/docker-entrypoint.sh /docker-entrypoint-initdb.d/init.sql;
1413
/usr/local/bin/docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=mysql_native_password --max_allowed_packet=$MYSQL_MAX_ALLOWED_PACKET --max_connections=$MYSQL_MAX_CONNECTION --long_query_time=$MYSQL_LONG_QUERY_TIME --sql_mode="NO_ENGINE_SUBSTITUTION" --slow_query_log=$MYSQL_SLOW_QUERY_LOG
15-
"
14+
\"
1615
environment:
1716
- MYSQL_ROOT_PASSWORD
1817
- MYSQL_MAX_ALLOWED_PACKET
@@ -27,4 +26,9 @@ services:
2726
volumes:
2827
- ${PHRASEANET_DB_DIR}_mysql8:/var/lib/mysql:rw
2928
networks:
30-
- internal
29+
internal:
30+
aliases:
31+
- db
32+
pre_stop:
33+
- command: '/usr/bin/mysqladmin -uroot -p"$MYSQL_ROOT_PASSWORD" shutdown'
34+

docker-compose.datastores.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,71 @@ services:
1919
volumes:
2020
- ${PHRASEANET_DB_DIR}:/var/lib/mysql
2121
networks:
22-
- internal
22+
internal:
23+
aliases:
24+
- db
25+
pre_stop:
26+
- command: '/usr/bin/mysqladmin -uroot -p"$MYSQL_ROOT_PASSWORD" shutdown'
2327

28+
db-docker-vol:
29+
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-db:$PHRASEANET_DOCKER_TAG
30+
build: ./docker/db
31+
restart: on-failure
32+
profiles: ["db-docker-vol"]
33+
environment:
34+
- MYSQL_ROOT_PASSWORD
35+
- MYSQL_MAX_ALLOWED_PACKET
36+
- MYSQL_MAX_CONNECTION
37+
- MYSQL_LONG_QUERY_TIME
38+
- MYSQL_SLOW_QUERY_LOG
39+
- MYSQL_QUERY_CACHE_LIMIT
40+
- MYSQL_QUERY_CACHE_SIZE
41+
- MYSQL_KEY_BUFFER_SIZE
42+
- MYSQL_CONNECT_TIMEOUT
43+
- MYSQL_WAIT_TIMEOUT
44+
- MARIADB_AUTO_UPGRADE
45+
volumes:
46+
- db_vol:/var/lib/mysql
47+
networks:
48+
internal:
49+
aliases:
50+
- db
51+
pre_stop:
52+
- command: '/usr/bin/mysqladmin -uroot -p"$MYSQL_ROOT_PASSWORD" shutdown'
2453
rabbitmq:
25-
image: $RABBITMQ_IMAGE_VERSION
54+
image: $RABBITMQ_IMAGE_TAG
2655
profiles: ["rabbitmq"]
2756
restart: on-failure
2857
hostname: $RABBITMQ_HOSTNAME
2958
environment:
3059
- RABBITMQ_DEFAULT_USER
3160
- RABBITMQ_DEFAULT_PASS
61+
- PHRASEANET_RABBITMQ_VHOST
3262
volumes:
3363
- rabbitmq_vol:/var/lib/rabbitmq
3464
networks:
3565
- internal
3666

3767
redis:
38-
image: redis
68+
image: $REDIS_CACHE_IMAGE_TAG
3969
profiles: ["redis"]
4070
restart: on-failure
4171
networks:
4272
- internal
4373

4474
redis-session:
45-
image: redis
75+
image: $REDIS_SESSION_IMAGE_TAG
4676
profiles: ["redis-session"]
4777
restart: on-failure
4878
networks:
4979
- internal
5080

5181
elasticsearch:
5282
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-elasticsearch:$PHRASEANET_DOCKER_TAG
83+
ulimits:
84+
nofile:
85+
soft: 65536
86+
hard: 65536
5387
profiles: ["elasticsearch"]
5488
build: ./docker/elasticsearch
5589
restart: on-failure

docker-compose.tools.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ services:
2828
restart: on-failure
2929
ports:
3030
- ${PHRASEANET_PHPMYADMIN_PORT}:80
31-
depends_on:
32-
- db
3331
networks:
3432
- internal
3533

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ services:
271271
- SESSION_SAVE_HANDLER
272272
- SESSION_SAVE_PATH
273273
- PHRASEANET_MAINTENANCE
274+
- PHRASEANET_MAINTENANCE_MESSAGE
274275
- FPM_MEMORY_LIMIT
275276
- FPM_PM_TYPE
276277
- FPM_MAXCHILDREN

lib/Alchemy/Phrasea/Controller/Prod/StoryController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function displayCreateFormAction(Request $request)
3535
$storyTitleMetaStructIds = [];
3636
foreach ($this->getApplicationBox()->get_databoxes() as $db) {
3737
foreach ($db->get_meta_structure() as $metaStruct) {
38-
if ($metaStruct->get_thumbtitle() == "1" &&
38+
if ($metaStruct->get_thumbtitle() != "0" &&
3939
!$metaStruct->is_readonly() &&
4040
$metaStruct->get_gui_editable() &&
4141
$metaStruct->get_type() == \databox_field::TYPE_STRING

0 commit comments

Comments
 (0)