mirror of
https://github.com/oxen-io/session-open-group-server.git
synced 2023-12-13 20:30:35 +01:00
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
|
echo "deb https://deb.oxen.io $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/oxen.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install session-open-group-server
|
sudo apt install session-open-group-server
|
||||||
sudo chown _loki /var/lib/session-open-group-server -R
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2: Add a room
|
### Step 2: Add a room
|
||||||
|
|
4
debian/session-open-group-server.postinst
vendored
4
debian/session-open-group-server.postinst
vendored
|
@ -21,12 +21,14 @@ if [ "$1" = configure ]; then
|
||||||
# Generate the key pair if needed
|
# Generate the key pair if needed
|
||||||
if ! [ -f $SOGS/x25519_private_key.pem ]; then
|
if ! [ -f $SOGS/x25519_private_key.pem ]; then
|
||||||
openssl genpkey -algorithm x25519 -out $SOGS/x25519_private_key.pem
|
openssl genpkey -algorithm x25519 -out $SOGS/x25519_private_key.pem
|
||||||
|
chown _loki $SOGS/x25519_private_key.pem
|
||||||
rm -f $SOGS/x25519_public_key.pem
|
rm -f $SOGS/x25519_public_key.pem
|
||||||
fi
|
fi
|
||||||
if ! [ -f $SOGS/x25519_public_key.pem ]; then
|
if ! [ -f $SOGS/x25519_public_key.pem ]; then
|
||||||
openssl pkey -in $SOGS/x25519_private_key.pem -pubout -out $SOGS/x25519_public_key.pem
|
openssl pkey -in $SOGS/x25519_private_key.pem -pubout -out $SOGS/x25519_public_key.pem
|
||||||
|
chown _loki $SOGS/x25519_public_key.pem
|
||||||
fi
|
fi
|
||||||
# Set permissions
|
# Set permissions
|
||||||
su -s /bin/sh _loki -c "test -O $SOGS && test -G $SOGS" || \
|
su -s /bin/sh _loki -c "test -O $SOGS && test -G $SOGS" || \
|
||||||
chown _loki:_loki $SOGS
|
chown _loki:_loki $SOGS
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue