chsasank / outline-wiki-docker-compose

Installation and docker compose to self host outline wiki: https://www.getoutline.com/
297 stars 76 forks source link

env.outline is malformed after running setup script #13

Closed jdan closed 3 years ago

jdan commented 3 years ago

Hi! Thanks for this - it let me try out outline in no time at all.

Wanted to file a lil bug for something a friend and I both caught independently. After going through make install I was receiving a 502 error. The logs mentioned something along the lines of: "Validation isIn on language failed." Curious, I poked around some of the env files and noticed the following at the bottom of env.outline

DEFAULT_LANGUAGE=en_USHOST=outline.jordanscales.com

(No space after en_US, which seemed relevant to "isIn on language failed"). Adding a newline to change the text to:

DEFAULT_LANGUAGE=en_US
HOST=outline.jordanscales.com

Fixed the issue on restart.

chsasank commented 3 years ago

May be something to do with bash/sed? Or may be linux/windows thingy?

narzero commented 3 years ago

Experienced the same issue where DEFAULT_LANGUAGE and HOST are one the same line in the env.outline file.

Ubuntu 20.04 Docker version 20.10.2, build 2291f61

6uhrmittag commented 3 years ago

Same. This is because the .env.sample doesn't end with a newline.

These variables use env_add - no sed involed, just echo.

cd /tmp
wget https://raw.githubusercontent.com/outline/outline/develop/.env.sample
echo "HOST" >> .env.sample
cat .env.sample

result:

# Custom logo that displays on the authentication screen, scaled to height: 60px
# TEAM_LOGO=https://example.com/images/logo.png

DEFAULT_LANGUAGE=en_USHOST

Simples fix is to just add an empty newline to https://raw.githubusercontent.com/outline/outline/develop/.env.sample

//edit: Sorry, the .env.sample is from outline, not this repo.

Possible fix:

sed -i "\$a'${key}'='${val}'" $filename

instead of

echo "${key}=${val}" >> $filename

test:

wget https://raw.githubusercontent.com/outline/outline/develop/.env.sample
tail .env.sample
filename=".env.sample";key=FOO;val=BAR;sed -i "\$a'${key}'='${val}'" $filename
tail .env.sample

(thx to: https://stackoverflow.com/questions/10082204/add-a-newline-only-if-it-doesnt-exist)