Fix postinst to properly chown privkeys
This commit is contained in:
parent
26851becfd
commit
177ae7fd2e
|
@ -21,7 +21,6 @@ sudo curl -so /etc/apt/trusted.gpg.d/oxen.gpg https://deb.oxen.io/pub.gpg
|
|||
echo "deb https://deb.oxen.io $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/oxen.list
|
||||
sudo apt update
|
||||
sudo apt install session-open-group-server
|
||||
sudo chown _loki /var/lib/session-open-group-server -R
|
||||
```
|
||||
|
||||
### Step 2: Add a room
|
||||
|
|
|
@ -21,12 +21,14 @@ if [ "$1" = configure ]; then
|
|||
# Generate the key pair if needed
|
||||
if ! [ -f $SOGS/x25519_private_key.pem ]; then
|
||||
openssl genpkey -algorithm x25519 -out $SOGS/x25519_private_key.pem
|
||||
chown _loki $SOGS/x25519_private_key.pem
|
||||
rm -f $SOGS/x25519_public_key.pem
|
||||
fi
|
||||
if ! [ -f $SOGS/x25519_public_key.pem ]; then
|
||||
openssl pkey -in $SOGS/x25519_private_key.pem -pubout -out $SOGS/x25519_public_key.pem
|
||||
chown _loki $SOGS/x25519_public_key.pem
|
||||
fi
|
||||
# Set permissions
|
||||
su -s /bin/sh _loki -c "test -O $SOGS && test -G $SOGS" || \
|
||||
chown _loki:_loki $SOGS
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue