Skip to content

Commit 48d1a4f

Browse files
authored
Merge branch 'master' into PHRAS-4146-abort-app-install-if-not-empty
2 parents 301cd15 + ad5c548 commit 48d1a4f

18 files changed

+429
-27
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@
3838
/www/thumbnails
3939
/www/.htaccess
4040
npm-debug.log
41+
stack_management.sh

.env

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ PHRASEANET_DOCKER_REGISTRY=alchemyfr
154154

155155
# Docker images tag.
156156
# @run
157-
PHRASEANET_DOCKER_TAG=4.1.17
157+
PHRASEANET_DOCKER_TAG=4.1.18
158158

159159
# Stack Name
160160
# An optionnal Name for the stack
@@ -278,6 +278,9 @@ RABBITMQ_MANAGEMENT_PORT=10811
278278
# @run
279279
RABBITMQ_HOSTNAME=rabbit_phraseanet
280280

281+
# @run
282+
RABBITMQ_IMAGE_VERSION=rabbitmq:4.1.0-management
283+
281284
# --- Gateway settings (Nginx) -----------------------------------------------------------------------------------------
282285

283286
# Value applied to "send_timeout", "keepalive_timeout", "client_header_timeout"
@@ -672,7 +675,7 @@ PHRASEANET_APP_PORT=8082
672675
PHRASEANET_ADMIN_ACCOUNT_ID=
673676

674677
# @run
675-
PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@alchemy.fr
678+
PHRASEANET_ADMIN_ACCOUNT_EMAIL=admin@phraseanet.local
676679

677680
# require to be change for securitie reasons
678681
# @run

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# CHANGELOG
22

3+
## 4.1.18
4+
5+
#### Phraseanet Upgrade
6+
7+
- **Phraseanet Migration Patch**:
8+
- A migration script for the configuration file is available. Run the following command in the setup container with Docker if the environment variable `PHRASEANET_UPGRADE=1` is set:
9+
```
10+
bin/setup system:upgrade
11+
```
12+
13+
14+
### Stack (Docker Compose and Helm)
15+
16+
- no change
17+
18+
### Version Summary
19+
20+
- Installation process (bin/setup system:install) now aborts if the application and/or databox contain existing data. the option -f also answer all questions for yes AND force installation to continue even if DB table already exist
21+
22+
## What's Changed
23+
* PHRAS-4146 bin/setup system:install - abort app installation if mysql db is not empty by @aynsix in https://github.com/alchemy-fr/Phraseanet/pull/4599
24+
25+
26+
**Full Changelog**: https://github.com/alchemy-fr/Phraseanet/compare/4.1.17...4.1.18
27+
28+
__
329
## 4.1.17
430
531
#### Phraseanet Upgrade
@@ -37,7 +63,7 @@
3763
3864
**Full Changelog**: https://github.com/alchemy-fr/Phraseanet/compare/4.1.16...4.1.17
3965
40-
66+
__
4167
## 4.1.16
4268
4369
### Update Instructions
@@ -111,6 +137,7 @@ The provided MariaDB container in the Docker Compose stack is not ready for prod
111137
112138
**Full Changelog**: https://github.com/alchemy-fr/Phraseanet/compare/4.1.15...4.1.16
113139
140+
__
114141
## 4.1.15
115142
116143
### Update Instructions

README.md

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

9999

100-
- docker >=v20.10.24
100+
- docker >=25.0.5
101+
- docker compose >= 2.29.0
101102

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

186187

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

190191
i.e:
191192
```bash
@@ -194,9 +195,28 @@ export [email protected]
194195
export INSTALL_ACCOUNT_PASSWORD=$3cr3t!
195196
export PHRASEANET_APP_PORT=8082
196197
```
198+
199+
If you want persit this change you can also save your change in a files named `env.local` or `.env.local`
200+
this files are git ignored and permit a stack customisation without git conflic generation
201+
see more about in stack management section
202+
197203
If you are not interested in the development of Phraseanet, you can ignore everything in `.env` after the `DEV Purpose` part.
198204

199205

206+
### stack Management
207+
208+
To start and stop the stack, use the `stack_management.sh start|stop|info|check|log` script at the project root.
209+
this script work only Linux and MacOS.
210+
211+
This script wrapping standard oprations for the stack, using standard docker compose cmd and take in account `.env` and `env.local | .env.local` files.
212+
213+
The `stop` operation is the most critical function of the script, as it ensures a clean shutdown
214+
of the database container before stopping the entire stack.
215+
216+
This script is useful if you are using the database container within the stack.
217+
218+
Of course before using it you need to chmod this file.
219+
200220
### Using a env.local method for custom .env values
201221

202222
It may be easier to deal with a local file to manage our env variables.

doc/API_documentation/v3/_compiled.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,36 @@ paths:
400400
401401
### results.records.technical_informations
402402
always included
403-
403+
404404
_nb:_ since stories are not related to a document, there is no technical_informations for stories.
405-
406-
### results.records.children
405+
406+
### results.records.stories
407+
Include a list of stories that contains the record
408+
409+
stories is an array of small objects containing only the `story_id` (= `record_id`) of the story.
410+
```
411+
"response": {
412+
"results": {
413+
"records": [
414+
{
415+
"stories": [
416+
{
417+
"story_id": 100
418+
},
419+
{
420+
"story_id": 102
421+
},
422+
...
423+
],
424+
...
425+
},
426+
...
427+
]
428+
}
429+
}
430+
```
431+
432+
### results.stories.children
407433
In story search mode, will publish a children[] array for each result. See _story_children_limit_ parameter.
408434
409435
children is an array of records, with same structure as a result record.

doc/API_documentation/v3/api.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,36 @@ paths:
443443
444444
### results.records.technical_informations
445445
always included
446-
446+
447447
_nb:_ since stories are not related to a document, there is no technical_informations for stories.
448-
449-
### results.records.children
448+
449+
### results.records.stories
450+
Include a list of stories that contains the record
451+
452+
stories is an array of small objects containing only the `story_id` (= `record_id`) of the story.
453+
```
454+
"response": {
455+
"results": {
456+
"records": [
457+
{
458+
"stories": [
459+
{
460+
"story_id": 100
461+
},
462+
{
463+
"story_id": 102
464+
},
465+
...
466+
],
467+
...
468+
},
469+
...
470+
]
471+
}
472+
}
473+
```
474+
475+
### results.stories.children
450476
In story search mode, will publish a children[] array for each result. See _story_children_limit_ parameter.
451477
452478
children is an array of records, with same structure as a result record.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Certainly! Here's a README for the script that provides an overview of its functionality, usage, and features:
2+
3+
---
4+
5+
# Docker Stack Management Script
6+
7+
This script is designed to manage a Docker stack, particularly for Phraseanet applications. It provides functionalities to start, stop, check, and gather information about the Docker stack, including version checks, log viewing, and environment details.
8+
9+
## Features
10+
11+
- **Start and Stop the Docker Stack**: Easily start or stop your Docker stack with simple commands.
12+
- **Version Checking**: Verify the compatibility of Docker and Docker Compose versions.
13+
- **Environment Information**: Gather detailed information about the environment, including Phraseanet installation status, version details, and internal URLs.
14+
- **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.
16+
17+
## Usage
18+
19+
### Prerequisites
20+
21+
- Docker and Docker Compose installed on your system.
22+
- Appropriate permissions to execute Docker commands.
23+
- Environment files (`.env`, `env.local`, or `.env.local`) configured with necessary variables.
24+
25+
### Commands
26+
27+
- **Start the Stack**:
28+
```bash
29+
./manage_docker.sh start
30+
```
31+
32+
- **Stop the Stack**:
33+
```bash
34+
./manage_docker.sh stop
35+
```
36+
37+
- **Check Versions**:
38+
```bash
39+
./manage_docker.sh check
40+
```
41+
42+
- **Display Environment Information**:
43+
```bash
44+
./manage_docker.sh info
45+
```
46+
47+
- **View Logs**:
48+
- For all containers:
49+
```bash
50+
./manage_docker.sh log
51+
```
52+
- For a specific container:
53+
```bash
54+
./manage_docker.sh log <container_name>
55+
```
56+
57+
### Environment Variables
58+
59+
The script uses the following environment variables, which should be defined in your environment files:
60+
61+
- `PHRASEANET_DOCKER_TAG`: The Docker tag for the Phraseanet image.
62+
- `PHRASEANET_DOCKER_REGISTRY`: The Docker registry for the Phraseanet image.
63+
- `PHRASEANET_HOSTNAME`: The hostname for the Phraseanet instance.
64+
- `PHRASEANET_SCHEME`: The scheme (e.g., `http` or `https`) for the Phraseanet instance.
65+
- `PHRASEANET_APP_PORT`: The port for the Phraseanet application.
66+
67+
### Notes
68+
69+
- Ensure that the environment files (`.env`, `env.local`, or `.env.local`) are correctly configured with the necessary variables.
70+
- The script checks for the presence of `config/configuration.yml` to determine if Phraseanet is installed.
71+
- The script constructs the internal URL of the Phraseanet instance using the environment variables `PHRASEANET_HOSTNAME`, `PHRASEANET_SCHEME`, and `PHRASEANET_APP_PORT`.
72+

docker-compose.altenatives.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42

53
db:

docker-compose.datastores.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
db:
53
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-db:$PHRASEANET_DOCKER_TAG
@@ -24,7 +22,7 @@ services:
2422
- internal
2523

2624
rabbitmq:
27-
image: rabbitmq:3.8.34-management
25+
image: $RABBITMQ_IMAGE_VERSION
2826
profiles: ["rabbitmq"]
2927
restart: on-failure
3028
hostname: $RABBITMQ_HOSTNAME

docker-compose.limits.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
gateway:
53
deploy:

0 commit comments

Comments
 (0)