* bug#61500: Default cache directory of cat-avatar-generator-service
@ 2023-02-14 3:10 Evgeny Pisemsky
2023-11-30 16:38 ` bug#61500: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service Evgeny Pisemsky
2024-12-14 18:28 ` bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
0 siblings, 2 replies; 3+ messages in thread
From: Evgeny Pisemsky @ 2023-02-14 3:10 UTC (permalink / raw)
To: 61500
Hello!
The cache directory must:
1. End with a slash (due to implementation of the php script).
2. Exist or be created manually.
3. Be writeable by php-fpm.
The current default value doesn't meet these requirements and leads to
broken caching and errors in php-fpm log.
The simplest solution is to change it to /tmp/, but for obvious
reasons it is not suitable for production use.
However, since this service is described as demonstration, I would
prefer unsafe default over broken (for now).
Also the requirements above should probably be mentioned in the
documentation of the service.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#61500: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service.
2023-02-14 3:10 bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
@ 2023-11-30 16:38 ` Evgeny Pisemsky
2024-12-14 18:28 ` bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
1 sibling, 0 replies; 3+ messages in thread
From: Evgeny Pisemsky @ 2023-11-30 16:38 UTC (permalink / raw)
To: 61500
[-- Attachment #1: Type: text/plain, Size: 136 bytes --]
Here is the simplest patch that changes cache directory to /tmp/ and
makes this service work with the recently added monsterid package.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-cat-http-server-Fix-cat-avatar-generator-se.patch --]
[-- Type: text/x-patch, Size: 2521 bytes --]
From d6778a511cd5c41755a8ba9853d0e9db8dd47997 Mon Sep 17 00:00:00 2001
Message-ID: <d6778a511cd5c41755a8ba9853d0e9db8dd47997.1701362094.git.evgeny@pisemsky.com>
From: Evgeny Pisemsky <evgeny@pisemsky.com>
Date: Thu, 30 Nov 2023 19:30:50 +0300
Subject: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service.
* gnu/services/web.scm (cat-avatar-generator-service): Change default cache
directory of the service and make it compatible with the monsterid package.
Change-Id: I94b4b2d8b01e8502222e4fd2a6aea247d6480312
---
doc/guix.texi | 3 ++-
gnu/services/web.scm | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 1fd2e21608..95a2f05633 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31752,7 +31752,7 @@ Web Services
the hash of a user's email address.
@deffn {Procedure} cat-avatar-generator-service @
- [#:cache-dir "/var/cache/cat-avatar-generator"] @
+ [#:cache-dir "/tmp/"] @
[#:package cat-avatar-generator] @
[#:configuration (nginx-server-configuration)]
Returns an nginx-server-configuration that inherits @code{configuration}. It
@@ -31764,6 +31764,7 @@ Web Services
A simple setup for cat-avatar-generator can look like this:
@lisp
(services (cons* (cat-avatar-generator-service
+ #:package monsterid
#:configuration
(nginx-server-configuration
(server-name '("example.com"))))
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 818226a4f7..47ca1e6968 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1158,7 +1158,7 @@ (define* (nginx-php-location
(define* (cat-avatar-generator-service
#:key
- (cache-dir "/var/cache/cat-avatar-generator")
+ (cache-dir "/tmp/")
(package cat-avatar-generator)
(configuration (nginx-server-configuration)))
(simple-service
@@ -1175,7 +1175,8 @@ (define* (cat-avatar-generator-service
(nginx-location-configuration-body base)))))
(nginx-server-configuration-locations configuration)))
(root #~(string-append #$package
- "/share/web/cat-avatar-generator"))))))
+ "/share/web/"
+ #$(package-name package)))))))
\f
(define-record-type* <hpcguix-web-configuration>
base-commit: c12cf2fb63bc2a5b0c5419a372ff6fff76a28a3b
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#61500: Default cache directory of cat-avatar-generator-service
2023-02-14 3:10 bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
2023-11-30 16:38 ` bug#61500: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service Evgeny Pisemsky
@ 2024-12-14 18:28 ` Evgeny Pisemsky
1 sibling, 0 replies; 3+ messages in thread
From: Evgeny Pisemsky @ 2024-12-14 18:28 UTC (permalink / raw)
To: 61500
> However, since this service is described as demonstration, I would prefer unsafe default over broken (for now).
I realized that this may look like an attempt to introduce vulnerabity, while in fact I was just silly. Shame on me.
The right thing to do here is to write a normal service instead of simple and create cache directory using activation service.
Or at least to update documentation of the existing service.
If someone at guix reads and wants this, please let me know.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-14 18:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 3:10 bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
2023-11-30 16:38 ` bug#61500: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service Evgeny Pisemsky
2024-12-14 18:28 ` bug#61500: Default cache directory of cat-avatar-generator-service Evgeny Pisemsky
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.