[Script Request] Outline #342
-
Hi There! Would love to see a script developed for Outline Wiki (https://github.com/outline/outline). Sadly i am not Linux orientated enough to get this up and running! I feel that their documentation is not detailed enough or they expect someone of quite significant Linux proficiency but sadly that isn't me haha. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 25 replies
-
Adding my vote! This has been on my mind for a while, seems great although not exactly a one-clic installation indeed, not sure if a script might support the setup since AFAIK you need to setup login through Google or Github or such identity providers so maybe it's not feasible or not a 1-click install solution... |
Beta Was this translation helpful? Give feedback.
-
Ok, I spent some time on this, and it is indeed complicated, some notes:
When the script is done:
And now finally the script (don't forget to change the URL): URL="https://outline.your.domain"
apt-get install -y \
sudo \
lsb-release \
postgresql \
gnupg \
git
mkdir -p /etc/apt/keyrings
NODE_MAJOR=20
wget -qO- https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
wget -qO- https://packages.redis.io/gpg | gpg --dearmor -o /etc/apt/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" >/etc/apt/sources.list.d/redis.list
apt-get update
apt-get install -y nodejs
npm install -g yarn
apt-get install -y redis
sed -i 's/^bind .*/bind 0.0.0.0/' /etc/redis/redis.conf
systemctl enable -q --now redis-server.service
git clone --depth 1 --branch v0.81.1 https://github.com/outline/outline.git /opt/outline
cd /opt/outline
# Instructions outline website
## First do CONFIGURATION
SECRET_KEY="$(openssl rand -hex 32)"
UTILS_SECRET="$(openssl rand -hex 32)"
DB_NAME=outlinedb
DB_USER=outline
DB_PASS="$(openssl rand -base64 18 | tr -d '/' | cut -c1-13)"
DATABASE_URL="postgres://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}"
REDIS_URL=redis://localhost:6379
FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
mkdir -p $FILE_STORAGE_LOCAL_ROOT_DIR
sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
# Give user permission to create dbs
sudo -u postgres psql -c "ALTER ROLE $DB_USER WITH CREATEDB;"
# Copied from linkwarden setup, not sure what these do
sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
{
echo "Outline-Credentials"
echo "Outline Database User: $DB_USER"
echo "Outline Database Password: $DB_PASS"
echo "Outline Database Name: $DB_NAME"
echo "Outline Secret: $SECRET_KEY"
echo "Outline Utils Secret: $UTILS_SECRET"
} >> ~/outline.creds
## Continue installation, first build in development
yarn install --no-optional --frozen-lockfile && yarn cache clean && yarn build
## Continue in production
rm -rf ./node_modules
yarn install --production=true--frozen-lockfile && yarn cache clean
env_path="/opt/outline/.env"
{
echo "NODE_ENV=production"
echo "SECRET_KEY=$SECRET_KEY"
echo "UTILS_SECRET=$UTILS_SECRET"
echo "DATABASE_URL=$DATABASE_URL"
echo "REDIS_URL=$REDIS_URL"
echo "URL=$URL"
echo "FILE_STORAGE=local"
echo "FILE_STORAGE_LOCAL_ROOT_DIR=$FILE_STORAGE_LOCAL_ROOT_DIR"
echo "WEB_CONCURRENCY=2"
} >$env_path
# set env based on env file
export $(grep -v '^#' $env_path | xargs -d '\n')
yarn sequelize db:create
yarn sequelize db:migrate
cat <<EOF >/etc/systemd/system/outline.service
[Unit]
Description=Outline Service
After=network.target
[Service]
Type=exec
EnvironmentFile=/opt/outline/.env
WorkingDirectory=/opt/outline
ExecStart=/usr/bin/yarn start
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now outline.service |
Beta Was this translation helpful? Give feedback.
-
Compose .yaml version: "3.2"
services:
outline:
image: docker.getoutline.com/outlinewiki/outline:latest
container_name: outline-app
hostname: outline-app
ports:
- 3000:3000
volumes:
- ./storage-data:/var/lib/outline/data
depends_on:
- postgres
- redis
environment:
PGSSLMODE: disable
SECRET_KEY: ${SECRET_KEY}
UTILS_SECRET: ${UTILS_SECRET}
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
URL: ${URL}
PORT: ${PORT}
FILE_STORAGE: local
FILE_STORAGE_LOCAL_ROOT_DIR: /var/lib/outline/data
FILE_STORAGE_UPLOAD_MAX_SIZE: 26214400
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
# SMTP Configuration
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USERNAME: ${SMTP_USERNAME}
SMTP_PASSWORD: ${SMTP_PASSWORD}
SMTP_FROM_EMAIL: ${SMTP_FROM_EMAIL}
SMTP_REPLY_EMAIL: ${SMTP_REPLY_EMAIL}
SMTP_TLS_CIPHERS: ${SMTP_TLS_CIPHERS}
SMTP_SECURE: ${SMTP_SECURE}
restart: unless-stopped
redis:
container_name: outline-redis
hostname: outline-redis
image: redis
volumes:
- ./redis.conf:/redis.conf
command:
- redis-server
- /redis.conf
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 10s
timeout: 30s
retries: 3
restart: unless-stopped
postgres:
image: postgres
container_name: outline-postgres
hostname: outline-postgres
volumes:
- ./database-data:/var/lib/postgresql/data
healthcheck:
test:
- CMD
- pg_isready
interval: 30s
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
restart: unless-stopped
networks: {} .env
|
Beta Was this translation helpful? Give feedback.
-
@burgerga just one stupid question. Do i need to install npm (node) or that comes with LXC |
Beta Was this translation helpful? Give feedback.
-
@burgerga I remembered that runtipi had option to create default user. Not sure if worth of your time but with that single users would not need to setup smtp or authentication process at all |
Beta Was this translation helpful? Give feedback.
-
script is PR at #2653 |
Beta Was this translation helpful? Give feedback.
script is PR at #2653