Просмотр исходного кода

Fix `make start` stopping on terminal resize (#9603)

* Fix `make start` stopping on terminal resize

* Update documentation examples for `docker run`

* Clarify Ctrl+C under Development mode section
Inverle 13 часов назад
Родитель
Сommit
67e05b0b77
4 измененных файлов с 17 добавлено и 8 удалено
  1. 1 0
      CHANGELOG.md
  2. 5 5
      Docker/README.md
  3. 10 2
      Makefile
  4. 1 1
      docs/en/admins/08_FeedUpdates.md

+ 1 - 0
CHANGELOG.md

@@ -32,6 +32,7 @@ See also [the FreshRSS releases](https://github.com/FreshRSS/FreshRSS/releases).
 	* GReader API: compare `Authorization:GoogleLogin` and other headers case insensitive [#9534](https://github.com/FreshRSS/FreshRSS/pull/9534)
 	* Return false when the configuration file cannot be replaced [#9580](https://github.com/FreshRSS/FreshRSS/pull/9580)
 	* Fix technical details in documentation system [#9520](https://github.com/FreshRSS/FreshRSS/pull/9520), [#9521](https://github.com/FreshRSS/FreshRSS/pull/9521)
+	* Fix `make start` development webserver stopping on terminal resize [#9603](https://github.com/FreshRSS/FreshRSS/pull/9603)
 * Security
 	* 💥 Replace bcrypt challenge auth with direct password comparison [#9358](https://github.com/FreshRSS/FreshRSS/pull/9358), [#9550](https://github.com/FreshRSS/FreshRSS/pull/9550), [#9566](https://github.com/FreshRSS/FreshRSS/pull/9566)
 	* Search: quote parentheses and `OR` when serialising terms [#9541](https://github.com/FreshRSS/FreshRSS/pull/9541)

+ 5 - 5
Docker/README.md

@@ -116,7 +116,7 @@ docker pull freshrss/freshrss:edge
 docker stop freshrss
 docker rename freshrss freshrss_old
 # See the run section above for the full command
-docker run ... --name freshrss freshrss/freshrss:edge
+docker run ... -d --name freshrss freshrss/freshrss:edge
 # If everything is working, delete the old container
 docker rm freshrss_old
 ```
@@ -154,7 +154,7 @@ while reading the source code from your local (git) directory, like the followin
 
 ```sh
 cd ./FreshRSS/
-docker run --rm \
+docker run --rm --sig-proxy=false \
   -p 8080:80 \
   -e FRESHRSS_ENV=development \
   -e TZ=Europe/Paris \
@@ -166,7 +166,7 @@ docker run --rm \
 ```
 
 This will start a server on port 8080, based on your local PHP code, which will show the logs directly in your terminal.
-Press <kbd>Control</kbd>+<kbd>C</kbd> to exit.
+Press <kbd>Control</kbd>+<kbd>C</kbd> 3 times to exit.
 
 ### Special development images
 
@@ -259,7 +259,7 @@ Changes in [Apache `.htaccess` files](https://httpd.apache.org/docs/trunk/howto/
 In particular, if you want FreshRSS to use HTTP-based login (instead of the easier Web form login), you can mount your own `./FreshRSS/p/i/.htaccess`:
 
 ```sh
-docker run ...
+docker run -d ...
   -v /your/.htaccess:/var/www/FreshRSS/p/i/.htaccess \
   -v /your/.htpasswd:/var/www/FreshRSS/data/.htpasswd \
   ...
@@ -632,7 +632,7 @@ containing a valid cron minute definition such as `13,43` (recommended) or `*/20
 Not passing the `CRON_MIN` environment variable – or setting it to empty string – will disable the cron daemon.
 
 ```sh
-docker run ... \
+docker run -d ... \
   -e CRON_MIN=13,43 \
   --name freshrss freshrss/freshrss:edge
 ```

+ 10 - 2
Makefile

@@ -47,16 +47,24 @@ build: ## Build a Docker image
 start: ## Start the development environment (use Docker)
 	$(DOCKER) network create --driver bridge $(NETWORK) || true
 	$(foreach extension,$(extensions),$(eval volumes=$(volumes) --volume $(extension):/var/www/FreshRSS/extensions/$(notdir $(extension)):z))
+	@# No TTY and no --sig-proxy: a terminal resize (SIGWINCH) must not reach Apache, which treats it as a graceful stop.
+	@# Ctrl+C is relayed by stopping the container instead.
+	trap '$(DOCKER) stop freshrss-dev >/dev/null' INT TERM; \
 	$(DOCKER) run \
-		-it \
 		--rm \
+		--sig-proxy=false \
 		--volume $(shell pwd):/var/www/FreshRSS:z \
 		$(volumes) \
 		--publish $(PORT):80 \
 		--env FRESHRSS_ENV=development \
 		--name freshrss-dev \
 		--network $(NETWORK) \
-		docker.io/freshrss/freshrss:$(TAG)
+		docker.io/freshrss/freshrss:$(TAG) & \
+	pid=$$!; \
+	wait $$pid; \
+	status=$$?; \
+	if [ "$$status" -gt 128 ]; then wait $$pid; status=$$?; fi; \
+	exit $$status
 
 .PHONY: stop
 stop: ## Stop FreshRSS container if any

+ 1 - 1
docs/en/admins/08_FeedUpdates.md

@@ -17,7 +17,7 @@ containing a valid cron minute definition such as `13,43` (recommended) or `*/20
 Not passing the `CRON_MIN` environment variable – or setting it to empty string – will disable the cron daemon.
 
 ```sh
-docker run ... \
+docker run -d ... \
   -e CRON_MIN=13,43 \
   --name freshrss freshrss/freshrss:edge
 ```