From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iF5+HQthhmOc3QAAbAwnHQ (envelope-from ) for ; Tue, 29 Nov 2022 20:44:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UEVhHQthhmMAmQAAauVa8A (envelope-from ) for ; Tue, 29 Nov 2022 20:44:11 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1B67F9476 for ; Tue, 29 Nov 2022 20:44:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p06W5-00077H-5q; Tue, 29 Nov 2022 14:43:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p06W2-00076y-Nd for help-guix@gnu.org; Tue, 29 Nov 2022 14:43:38 -0500 Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p06Vr-0006Gh-Go for help-guix@gnu.org; Tue, 29 Nov 2022 14:43:38 -0500 Received: from [2a01:e0a:acc:b9b0:13f:c961:cb0d:71c3] (port=53138 helo=timo-pc) by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p06Vo-002VaV-G7; Tue, 29 Nov 2022 19:43:24 +0000 Date: Tue, 29 Nov 2022 20:43:18 +0100 From: Timo Wilken To: Julien Lepiller , help-guix@gnu.org Subject: Re: How do I install a file with custom permissions? Message-ID: <20221129194318.qqb4ntwg7poic2ia@timo-pc> References: <20221129192413.q75rkyevtrtslyix@timo-pc> <66FA4764-AAD9-4A40-AA34-73C918B5F3D6@lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <66FA4764-AAD9-4A40-AA34-73C918B5F3D6@lepiller.eu> X-BlackCat-Spam-Score: 14 Received-SPF: pass client-ip=2a00:1098:0:82:1000:0:2:1; envelope-from=guix@twilken.net; helo=mx2.mythic-beasts.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669751051; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XiHLVtrVKRj3ftcl/UlyY4nQG0dznJnUm6N9YC87MqU=; b=aiiC57krV9+TASVd989hcdHPshjNB6dJhrxZZdI6iiZ8W3SmcaBuxiXhgBa91RaQI6daMI aFWLmGXge1kqpIQhRV6aAvTpb7/ZW+V/GMY1nGXNsQ1VlYhYwJawdLIS9q6ckcbkc+PwEM EMb9TrK/OL2gmmCa66Kmsr1Pjq16pHaJ9IQ/aeBUSTm3FTBAuJjTmJgKNgnlEsAyrcodSv pTf9O3RCd0kzaKSXu8EiQ7KQjTQdWY/SQH1D3moLohb+8cWTwQ9FC+vHF7JlKcwOmpqiGZ M98H6o/dxI82VgbEicEEKEju6+20ZMbJXWcLlkdK4r/DxGrglMotMtx87dARQw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669751051; a=rsa-sha256; cv=none; b=H5vVWWMpYRKlq6WSxeBTZvSvDioLhFKU0EXcyuGWxRf26Ko17hjZPJfkLveYYSOaF+7USV RZzt4r0xYqzyPsQkYYJQvT30wRIaZ8WACfSbzoKrMPMbQ/Z9zlgQePlLMRSbt/A7CylLu/ vwoouYS/RHnot6GOziWD3bTQDsQXtKesmILeZXHvHiX5K+Gnke5P9N1slgg4/SRUl+nU8v Sgojmkpxn+BNfkCM8xrXjr0wAhWfjSuH8hP2ZiJJr9roZDcNtwmm3oXtvI2wx1JN05kJl6 rOwwrO0ifX+V5/yzc7WtyUy2uuvtYq1mDQftxCJ8cEEenAHT6fuaipopjYTgTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.36 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1B67F9476 X-Spam-Score: -2.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: kLiPFHqxXl47 Hi Julien, Thanks! It did seem slightly odd to me how `wireguard-service-type' set the private key in a bit of a roundabout way, by referring to an external file. I'll try and set the pre-shared keys the same way. Cheers, Timo On Tue, Nov 29, 2022 at 08:34:21PM +0100, Julien Lepiller wrote: > Hi Timo, > > Files in the store are always world-readable and there's nothing you can do to change that. There has been discussions in the past about how to handle secrets in the store, but no solution so far. > > One thing you can do, if wireguard allows it, is to have the pre-shared key in a separate file out of the store and simply point the config to that file (instead of using a file-like object). This is how we handle other secrets so far. > > Le 29 novembre 2022 20:24:13 GMT+01:00, Timo Wilken a écrit : > >Hi Guixers, > > > >I'm trying to patch the `wireguard-service-type' to accept pre-shared > >keys and add them to the generated config. This all seems to work > >fine, except that I can't get guix to generate a non-world-readable > >configuration file. > > > >I've tried adding a `(chmod port #o400)' call to the end of the lambda > >that generates the config file (gnu/services/vpn.scm lines 784-838), > >but that seems to have no effect -- the resulting file at > >/gnu/store/...-wireguard-config/wg0.conf is still > >world-readable. Adding `(chmod #$config-file #o400)' after the > >`call-with-output-file' call doesn't work either. > > > >What do I need to do to make guix install the generated config file > >with 0400 permissions? > > > >Cheers, > >Timo > >