all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Privoxy user config without hard-coded GNU store path?
@ 2019-10-06 11:51 Pierre Neidhardt
  2019-10-06 12:22 ` Efraim Flashner
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Neidhardt @ 2019-10-06 11:51 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

Hi!

I start a privoxy daemon on login like this:

--8<---------------cut here---------------start------------->8---
privoxy --no-daemon ~/.config/privoxy/config &
--8<---------------cut here---------------end--------------->8---

~/.config/privoxy/config contains essentially this:


--8<---------------cut here---------------start------------->8---
## Mandatory options:
confdir /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/etc/privoxy
logdir /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/var/log/privoxy

## My options:
       forward-socks5t   /               127.0.0.1:9050 .
--8<---------------cut here---------------end--------------->8---

The problem is that the config won't stand an upgrade +
garbage-collection of the old path.

Ideally, we could have a Shepherd service to start and configure privoxy
reliably.

Is there any other way to configure privoxy reliably?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Privoxy user config without hard-coded GNU store path?
  2019-10-06 11:51 Privoxy user config without hard-coded GNU store path? Pierre Neidhardt
@ 2019-10-06 12:22 ` Efraim Flashner
  2019-10-06 12:46   ` Pierre Neidhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2019-10-06 12:22 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]

On Sun, Oct 06, 2019 at 01:51:43PM +0200, Pierre Neidhardt wrote:
> Hi!
> 
> I start a privoxy daemon on login like this:
> 
> --8<---------------cut here---------------start------------->8---
> privoxy --no-daemon ~/.config/privoxy/config &
> --8<---------------cut here---------------end--------------->8---
> 
> ~/.config/privoxy/config contains essentially this:
> 
> 
> --8<---------------cut here---------------start------------->8---
> ## Mandatory options:
> confdir /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/etc/privoxy
> logdir /gnu/store/b1nv74wiz4i32vracafmdqiij8y8p7il-privoxy-3.0.28/var/log/privoxy
> 
> ## My options:
>        forward-socks5t   /               127.0.0.1:9050 .
> --8<---------------cut here---------------end--------------->8---
> 
> The problem is that the config won't stand an upgrade +
> garbage-collection of the old path.

The simple solution here is to change the lines to 
confdir /home/USER/.guix-profile/etc/privoxy
logdir /home/USER/log/privoxy

> 
> Ideally, we could have a Shepherd service to start and configure privoxy
> reliably.
> 
> Is there any other way to configure privoxy reliably?
> 

If you want an untested user shepherd service, here's one I've come up
with on the spot:

(define privoxy
  (make <service>
  #:provides '(privoxy)
  #:docstring "Privoxy filters outgoing internet connections"
  #:start (make-forkexec-constructor
            '("/var/guix/profiles/per-user/USER/current-guix/bin/privoxy" "--no-daemon" "/home/USER/.config/privoxy/config")
            #:log-file "/home/USER/log/privoxy/privoxy.log")
  #:stop (make-kill-destructor)
  #:respawn? #t))
(register-services privoxy)

And then you'd add that to your ~/.config/shepherd/init.scm

I have at the bottom of mine:
;; Send shepherd into the background
(action 'shepherd 'daemonize)

(for-each start '(syncthing kdeconnect))

and at the top:
(use-modules (shepherd service))


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Privoxy user config without hard-coded GNU store path?
  2019-10-06 12:22 ` Efraim Flashner
@ 2019-10-06 12:46   ` Pierre Neidhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Neidhardt @ 2019-10-06 12:46 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

Hi Efraim!

Thanks for the suggestions!

> The simple solution here is to change the lines to 
> confdir /home/USER/.guix-profile/etc/privoxy
> logdir /home/USER/log/privoxy

Duh, that was easy! :p

> If you want an untested user shepherd service, here's one I've come up
> with on the spot:
>
> (define privoxy
>   (make <service>
>   #:provides '(privoxy)
>   #:docstring "Privoxy filters outgoing internet connections"
>   #:start (make-forkexec-constructor
>             '("/var/guix/profiles/per-user/USER/current-guix/bin/privoxy" "--no-daemon" "/home/USER/.config/privoxy/config")
>             #:log-file "/home/USER/log/privoxy/privoxy.log")
>   #:stop (make-kill-destructor)
>   #:respawn? #t))
> (register-services privoxy)

That's a good starting point, but furthermore what I meant was a service
in which we declare the configuration file, so that I don't need to
provide my own "config".

I guess that'd be another neat service to add to Shepherd/Guix ;)

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-06 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-06 11:51 Privoxy user config without hard-coded GNU store path? Pierre Neidhardt
2019-10-06 12:22 ` Efraim Flashner
2019-10-06 12:46   ` Pierre Neidhardt

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.