gogs service: fix encoding of secret key

I was getting a secret key like this:

  [security]
  SECRET_KEY = 7X

Use coreutils base64 instead to get the full 256 bits of randomness.
This commit is contained in:
Rodney Lorrimar 2017-04-22 16:53:35 +01:00
parent 5f9096a033
commit 0c9512d263

View File

@ -169,7 +169,7 @@ in
${optionalString (cfg.useWizard == false) ''
mkdir -p ${cfg.stateDir}/custom/conf
cp -f ${configFile} ${cfg.stateDir}/custom/conf/app.ini
KEY=$(head -c 16 /dev/urandom | tr -dc A-Za-z0-9)
KEY=$(head -c 16 /dev/urandom | base64)
sed -i "s,#secretkey#,$KEY,g" ${cfg.stateDir}/custom/conf/app.ini
''}