In the previous article, we covered how to quickly deploy and use Outline. This article will expand on some of the details of Outline configuration.

Writing in the front

For ease of use, I use the sample code from the previous article github.com/soulteary/d… Some updates were made to add a storage initialization script and upgrade Outline to the latest official version.

So, if you have downloaded code before, you are advised to either download a new copy of the code or do a Git pull update.

The “configuration constants” mentioned below refer to the contents of the.env file in the project. If you don’t already know this part, please refer to the Outline of Using Open Source Documentation /Wiki software from Scratch.

How to manage pictures

For those of you who have finished building for the last article, you will find that the Outline cannot upload images correctly, prompting “Sorry, an error occurred the image while uploading it” in the lower left corner of the page.

The reason for this problem is that miniO is not initialized automatically. In our previous software, many software will determine whether the storage space exists, and if not, it will be created automatically. However, in the current version of Outline and Minio, this function is not implemented, so we need to create it manually.

Considering the practical experience of most students, I created an additional configuration file named docker-comemage.minio-init. yml to make the operation easier:

version: "3"
services:

  minio-client:
    image: ${DOCKER_MINIO_CLIENT_IMAGE_NAME}
    entrypoint: > /bin/sh -c " /usr/bin/mc config host rm local; /usr/bin/mc config host add --quiet --api s3v4 local http://outline_minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}; /usr/bin/mc mb --quiet local/${AWS_S3_UPLOAD_BUCKET_NAME}/; /usr/bin/mc policy set public local/${AWS_S3_UPLOAD_BUCKET_NAME}; "    networks:
      - outline

networks:
  outline:
    external: true
Copy the code

With the configuration file above, you only need to execute one more command line after starting Outline:

docker-compose -f docker-compose.minio-init.yml up
Copy the code

Once the command is executed, you should see log output similar to the following.

Creating docker-outline_minio-client_1 ... done
Attaching to docker-outline_minio-client_1
minio-client_1  | Removed `local` successfully.
minio-client_1  | Added `local` successfully.
minio-client_1  | Bucket created successfully `local/outline/`.
minio-client_1  | Access permission for `local/outline` is set to `public`
docker-outline_minio-client_1 exited with code 0
Copy the code

Next, try uploading the image again in Outline, and you’ll see that it works.

How do I delete images completely

Although the Outline editor included a “delete images from articles” function, we didn’t actually delete the content we uploaded correctly. Let’s use the default Settings to explain how to delete uploaded image files completely.

When you open file.lab.com (DOCKER_MINIO_HOSTNAME), you are automatically directed to file-admin.lab.com/login (DOCKER_MINIO_ADMIN_DOMAIN).

After you log in to the MinIO management page using the MINIO_ROOT_USER and MINIO_ROOT_PASSWORD as the account and password, you can view the MinIO management page.

Find “Object Browser” in the left sidebar, and then find the name of the image we uploaded and delete it here to achieve the complete deletion we expect.

In the future, I will consider submitting a PR to solve this problem, or using a simpler way to do image attachment management. This topic is too far from this article to be discussed.

How to use attachments

The current version of Outline does not support attachments, so we need to solve this problem for now with “external help”. In the last article, we started a small and efficient file server, and in this article we will show how to use Outline together.

First use the browser to access attachment.lab.com (DOCKER_ATTACHMENT_HOSTNAME) and you will be prompted to enter the user password. This is to prevent unauthorized users from committing. If you do not want to use Basic Auth, You can also check out Traefik 2 Basic Authorization Verification (Part 1) and Traefik 2 Basic Authorization Verification (Part 2) for a more modern approach to access protection.

After logging in using the username and password configured in DOCKER_ATTACHMENT_BASIC_AUTH, you can view the page of the file server.

The interface is very simple, drag the file you want to upload to the upload area, or select the file using the file picker to start uploading attachments of any size.

During the upload process, we can see the upload progress in real time. After the file is uploaded, we can click the text link before DELETE to enter the attachment details page.

On the Attachment details page, copy the GET text link and you will get an address containing the “RAW” string that is publicly accessible. (No login operation is required.)

Then copy the attachment address into the Outline article and you are free to use it.

It is said that the next version of Outline will support attachment management, but considering the stability of storage data, it is recommended to use such external storage mode first, and wait for the new function and data management logic to stabilize, then migrate to switch.

The last

In the next Outline, I’ll probably talk about how to customize an Outline quickly.

After all, a good documentation application is one that belongs to you and works for your team.

–EOF


We have a little group of hundreds of people who like to do things.

In the case of no advertisement, we will talk about software and hardware, HomeLab and programming problems together, and also share some information of technical salon irregularly in the group.

Like to toss small partners welcome to scan code to add friends. (To add friends, please note your real name, source and purpose, otherwise it will not be approved)

All this stuff about getting into groups


If you think the content is still practical, welcome to share it with your friends. Thank you.


This article is published under a SIGNATURE 4.0 International (CC BY 4.0) license. Signature 4.0 International (CC BY 4.0)

Author: Su Yang

Creation time: September 11, 2021 statistical word count: 3727 words reading time: 8 minutes to read this article links: soulteary.com/2021/09/11/…