enable_encrypt_syno.sh 881 Bytes
Newer Older
pasden's avatar
pasden committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/sh

container_name="itinvent"
syno_certs_path="/usr/syno/etc/certificate/_archive/DmsD54"

docker cp $syno_certs_path/cert.pem $container_name:/var/opt/mssql/data/cert.pem
docker cp $syno_certs_path/privkey.pem $container_name:/var/opt/mssql/data/privkey.pem

# https://ask-ubuntu.ru/questions/41943/letsencrypt-dlya-sql-server-v-linux
docker exec -it $container_name /bin/sh -c "\
cd /var/opt/mssql/data/; \
openssl rsa -in ./privkey.pem -out ./mssql.key; \
chown root:root ./cert.pem ./mssql.key; \
chmod 600 ./cert.pem ./mssql.key; \
/opt/mssql/bin/mssql-conf set network.tlscert /var/opt/mssql/data/cert.pem; \
/opt/mssql/bin/mssql-conf set network.tlskey /var/opt/mssql/data/mssql.key; \
/opt/mssql/bin/mssql-conf set network.tlsprotocols 1.2; \
/opt/mssql/bin/mssql-conf set network.forceencryption 1; \
"
docker restart $container_name
docker logs -f $container_name