Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Outline #2651

Merged
merged 16 commits into from
Mar 4, 2024
Merged

Add Outline #2651

merged 16 commits into from
Mar 4, 2024

Conversation

sergi0g
Copy link
Contributor

@sergi0g sergi0g commented Mar 3, 2024

Closes #8, #1519, #2205

Summary by CodeRabbit

  • New Features
    • Implemented Nginx configuration to support Outline Wiki and OIDC Server integration.
    • Added a configuration template for OIDC client setup for "outline."
    • Introduced comprehensive documentation for the "Outline" application, detailing features and capabilities as a collaborative knowledge base.

Copy link
Contributor

coderabbitai bot commented Mar 3, 2024

Important

Auto Review Skipped

Review was skipped due to path filters

Files ignored due to path filters (2)
  • apps/outline/config.json is excluded by: !**/*.json
  • apps/outline/docker-compose.yml is excluded by: !**/*.yml

Walkthrough

The changes involve integrating the Outline Wiki application with an OIDC server for authentication. Nginx is set up as a reverse proxy to serve the Outline Wiki and the OIDC Server. Furthermore, a detailed description of the Outline application is included, highlighting its collaborative features and competitive positioning in the knowledge base domain.

Changes

File Path Change Summary
.../nginx/default.conf Configures Nginx as a reverse proxy for Outline Wiki and an OIDC Server
.../oidc-config.json.template Introduces a new configuration template for an OIDC client named "outline"
.../metadata/description.md Presents a new file detailing the features of the "Outline" application and its competitive stance

Assessment against linked issues

Objective Addressed Explanation
[APP REQUEST] Outline Wiki (#8)

Poem

In a burrow, deep and wide,
A rabbit worked with joy and pride.
🐇💻 With code and care, it did confide,
A wiki born, to spread worldwide.
Through proxy's gate, it shall glide,
With OIDC by its side.
"Let knowledge flow," it softly sighed,
"In Outline's halls, let it reside."

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3aad663 and f831421.
Files ignored due to path filters (3)
  • apps/outline/config.json is excluded by: !**/*.json
  • apps/outline/docker-compose.yml is excluded by: !**/*.yml
  • apps/outline/metadata/logo.jpg is excluded by: !**/*.jpg
Files selected for processing (3)
  • apps/outline/data/nginx/default.conf (1 hunks)
  • apps/outline/data/oidc-config.json.template (1 hunks)
  • apps/outline/metadata/description.md (1 hunks)
Additional comments: 1
apps/outline/data/oidc-config.json.template (1)
  • 19-19: Ensure that the {{APP_DOMAIN}} placeholder in the _redirect_uris field is correctly replaced with the actual application domain during deployment. Incorrect or missing domain information can lead to authentication failures.

apps/outline/metadata/description.md Outdated Show resolved Hide resolved
apps/outline/data/nginx/default.conf Outdated Show resolved Hide resolved
apps/outline/data/oidc-config.json.template Show resolved Hide resolved
apps/outline/data/oidc-config.json.template Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f831421 and 47ab8aa.
Files ignored due to path filters (1)
  • apps/outline/config.json is excluded by: !**/*.json
Files selected for processing (2)
  • apps/outline/data/nginx/default.conf (1 hunks)
  • apps/outline/metadata/description.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/outline/data/nginx/default.conf

apps/outline/metadata/description.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@steveiliop56 steveiliop56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @hex-developer,

Nice app, left you some comments for some small issues, not preventing the use of the app but with them its easier for us to better understand/maintain the compose and config files.

apps/outline/config.json Outdated Show resolved Hide resolved
apps/outline/data/pgdata/.gitkeep Outdated Show resolved Hide resolved
apps/outline/data/uc/db/.gitkeep Outdated Show resolved Hide resolved
apps/outline/data/uc/static_root/.gitkeep Outdated Show resolved Hide resolved
apps/outline/docker-compose.yml Outdated Show resolved Hide resolved
apps/outline/docker-compose.yml Show resolved Hide resolved
apps/outline/docker-compose.yml Outdated Show resolved Hide resolved
apps/outline/docker-compose.yml Show resolved Hide resolved
apps/outline/docker-compose.yml Show resolved Hide resolved
apps/outline/config.json Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 47ab8aa and 8009195.
Files ignored due to path filters (2)
  • apps/outline/config.json is excluded by: !**/*.json
  • apps/outline/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (2)
  • apps/outline/data/oidc-config.json.template (1 hunks)
  • apps/outline/metadata/description.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/outline/data/oidc-config.json.template
Additional comments: 3
apps/outline/metadata/description.md (3)
  • 2-2: The description "A fast, collaborative, knowledge base for your team built using React and Node.js." is clear and concise. However, the static analysis tool flagged a possible spelling mistake related to the image tag, which is a false positive in this context. The usage of the image tag is correct for Markdown syntax, so no action is needed here.
  • 5-5: The phrase "Outline is a full-featured knowledge base and is a great alternative to Notion, Obsidian and other similar apps." is effective in positioning Outline. However, the static analysis tool suggested replacing "and" with "that" or "which" to strengthen the wording. In this context, the original wording is appropriate as it conveys the intended meaning clearly. The suggestion to replace "and" might not apply well here since the sentence structure does not warrant such replacements for clarity or grammatical correctness.
  • 1-13: Overall, the description.md file provides a comprehensive and engaging summary of Outline Wiki. It effectively highlights the key features and advantages of using Outline as a knowledge base tool. The inclusion of an image is a good practice for visual appeal, and the concise list of features makes it easy for readers to understand the value proposition of Outline. The link to the official website is also a helpful addition for users seeking more information.

@meienberger
Copy link
Collaborator

GG @hex-developer this was a long time requested app

@steveiliop56
Copy link
Collaborator

@meienberger will test today and merge.

Copy link
Collaborator

@steveiliop56 steveiliop56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hex-developer just a small bug.

apps/outline/docker-compose.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8009195 and 311e5d3.
Files ignored due to path filters (1)
  • apps/outline/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (1)
  • apps/outline/data/nginx/default.conf (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/outline/data/nginx/default.conf

@steveiliop56
Copy link
Collaborator

@hex-developer I fixed some small typos in your pr but I unfortunately can't get the app to work. Outline says this after I login in the oidc app:

image

The logs of the outline container are (after the migrations):

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
{"label":"lifecycle","level":"info","message":"Listening on http://localhost:3000 / https://outline.tipi-testing.local"}
{"error":"connect ECONNREFUSED 127.0.0.1:443","level":"error","message":"Error during authentication","stack":"Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)"}
{"error":"connect ECONNREFUSED 127.0.0.1:443","level":"error","message":"Error during authentication","stack":"Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)"}

I am not providing logs of oidc, db, redis, proxy because they don't print out any error.

@sergi0g
Copy link
Contributor Author

sergi0g commented Mar 4, 2024

@hex-developer I fixed some small typos in your pr but I unfortunately can't get the app to work. Outline says this after I login in the oidc app:
image

The logs of the outline container are (after the migrations):

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
{"label":"lifecycle","level":"info","message":"Listening on http://localhost:3000 / https://outline.tipi-testing.local"}
{"error":"connect ECONNREFUSED 127.0.0.1:443","level":"error","message":"Error during authentication","stack":"Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)"}
{"error":"connect ECONNREFUSED 127.0.0.1:443","level":"error","message":"Error during authentication","stack":"Error: connect ECONNREFUSED 127.0.0.1:443\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)"}

I am not providing logs of oidc, db, redis, proxy because they don't print out any error.

If you have access to something like Portainer, could you please show me the environment variables for Outline?

UPDATE: I just tested with a reinstall and I had no error. Do you maybe have a custom configuration (e.g. running in a VM)?

@steveiliop56
Copy link
Collaborator

@hex-developer here you go:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=3a5e8b93e74e
TERM=xterm
OIDC_CLIENT_ID=9768ca01522903a357310c9af3ff7c3b
UTILS_SECRET=397a51544005b3b3107e376e15d5ec77
DATABASE_URL=postgres://outline:543d2da2d6901c3a77c8fd9e95d62ab4@outline-postgres:5432/outline
OIDC_DISPLAY_NAME=OpenID
PGSSLMODE=disable
OIDC_TOKEN_URI=https://outline.tipi-testing.local/uc/oauth/token/
OIDC_USERINFO_URI=https://outline.tipi-testing.local/uc/oauth/userinfo/
OIDC_SCOPES=openid profile email
FILE_STORAGE=local
URL=https://outline.tipi-testing.local
SECRET_KEY=6809fcec117394f9a98aa7c004c717ade6b3f3e613a4ab5ed0ec38751ca26dd0
OIDC_CLIENT_SECRET=6b4a62848a59b8c894eade66e19a7ea8
OIDC_USERNAME_CLAIM=preferred_username
OIDC_AUTH_URI=https://outline.tipi-testing.local/uc/oauth/authorize/
FILE_STORAGE_UPLOAD_MAX_SIZE=26214400
FORCE_HTTPS=false
REDIS_URL=redis://outline-redis:6379
NODE_VERSION=20.11.1
YARN_VERSION=1.22.19
NODE_ENV=production
FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
HOME=/home/nodejs

Note that I am trying inside WSL with the dns being the hosts file of windows. But that shouldn't be a problem since the app seems to have an internal error.

@sergi0g
Copy link
Contributor Author

sergi0g commented Mar 4, 2024

@hex-developer here you go:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=3a5e8b93e74e
TERM=xterm
OIDC_CLIENT_ID=9768ca01522903a357310c9af3ff7c3b
UTILS_SECRET=397a51544005b3b3107e376e15d5ec77
DATABASE_URL=postgres://outline:543d2da2d6901c3a77c8fd9e95d62ab4@outline-postgres:5432/outline
OIDC_DISPLAY_NAME=OpenID
PGSSLMODE=disable
OIDC_TOKEN_URI=https://outline.tipi-testing.local/uc/oauth/token/
OIDC_USERINFO_URI=https://outline.tipi-testing.local/uc/oauth/userinfo/
OIDC_SCOPES=openid profile email
FILE_STORAGE=local
URL=https://outline.tipi-testing.local
SECRET_KEY=6809fcec117394f9a98aa7c004c717ade6b3f3e613a4ab5ed0ec38751ca26dd0
OIDC_CLIENT_SECRET=6b4a62848a59b8c894eade66e19a7ea8
OIDC_USERNAME_CLAIM=preferred_username
OIDC_AUTH_URI=https://outline.tipi-testing.local/uc/oauth/authorize/
FILE_STORAGE_UPLOAD_MAX_SIZE=26214400
FORCE_HTTPS=false
REDIS_URL=redis://outline-redis:6379
NODE_VERSION=20.11.1
YARN_VERSION=1.22.19
NODE_ENV=production
FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
HOME=/home/nodejs

Note that I am trying inside WSL with the dns being the hosts file of windows. But that shouldn't be a problem since the app seems to have an internal error.

The environment looks fine, so if there's a problem it's probably WSL. Can you please test on a server running Linux?

@steveiliop56
Copy link
Collaborator

Huh weird, I will set up a VM and test.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 311e5d3 and 716129a.
Files ignored due to path filters (2)
  • apps/outline/config.json is excluded by: !**/*.json
  • apps/outline/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (1)
  • apps/outline/data/nginx/default.conf (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/outline/data/nginx/default.conf

@steveiliop56
Copy link
Collaborator

@hex-developer tested on an ubuntu 23 VM and still the same problem. Also I noticed you added a Is your certificate self-signed? which I don't like the idea a lot because I am sure that someone will mess it up and break the app.

@sergi0g
Copy link
Contributor Author

sergi0g commented Mar 4, 2024

I agree it shouldn't be there. Feel free to convert this PR into a draft until I fix the authentication errors.

@sergi0g
Copy link
Contributor Author

sergi0g commented Mar 4, 2024

I've updated the app and have had no problems on both my Tipi instances. Please test again.

@steveiliop56
Copy link
Collaborator

Everything is working fine except the logout button. Can we make this work?

@sergi0g
Copy link
Contributor Author

sergi0g commented Mar 4, 2024

Outline cannot be configured for this yet, because it tries to log out with a GET request. The OIDC provider currently used only supports POST requests for logout, but there is an open issue for this feature (juanifioren/django-oidc-provider#416). When (and if) the functionality is added, I will add a logout feature. I could also try writing a custom route for that in the OIDC provider if you think it is really needed.

@steveiliop56
Copy link
Collaborator

steveiliop56 commented Mar 4, 2024

Its fine for now but it would be nice if you could push an update as soon as possible. I will merge for now as this is not limiting the functionality of the app.

@steveiliop56 steveiliop56 merged commit 63b7f29 into runtipi:master Mar 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APP REQUEST] Outline Wiki
3 participants