Merge pull request #1321 from drudge/templates/outline

feat(template): add outline
This commit is contained in:
Mauricio Siu 2025-02-15 13:29:18 -06:00 committed by GitHub
commit ba54124a56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 165 additions and 2 deletions

View File

@ -70,9 +70,9 @@ import type {
} from "next";
import Head from "next/head";
import { useRouter } from "next/router";
import { useMemo, useState, type ReactElement } from "react";
import superjson from "superjson";
import { type ReactElement, useMemo, useState } from "react";
import { toast } from "sonner";
import superjson from "superjson";
export type Services = {
appName: string;

View File

@ -0,0 +1 @@
<svg fill="#000" width="32" height="32" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><path d="M32,57.6 L32,59.1606101 C32,61.3697491 30.209139,63.1606101 28,63.1606101 C27.3130526,63.1606101 26.6376816,62.9836959 26.038955,62.6469122 L2.03895504,49.1469122 C0.779447116,48.438439 -4.3614532e-15,47.1057033 -7.10542736e-15,45.6606101 L-7.10542736e-15,18.3393899 C-7.28240024e-15,16.8942967 0.779447116,15.561561 2.03895504,14.8530878 L26.038955,1.35308779 C27.9643866,0.270032565 30.4032469,0.952913469 31.4863021,2.87834498 C31.8230858,3.47707155 32,4.15244252 32,4.83938994 L32,6.4 L34.8506085,5.54481746 C36.9665799,4.91002604 39.1965137,6.11075966 39.8313051,8.22673106 C39.9431692,8.59961116 40,8.98682435 40,9.3761226 L40,11 L43.5038611,10.5620174 C45.6959408,10.2880074 47.6951015,11.8429102 47.9691115,14.0349899 C47.9896839,14.1995692 48,14.3652688 48,14.5311289 L48,49.4688711 C48,51.6780101 46.209139,53.4688711 44,53.4688711 C43.8341399,53.4688711 43.6684404,53.458555 43.5038611,53.4379826 L40,53 L40,54.6238774 C40,56.8330164 38.209139,58.6238774 36,58.6238774 C35.6107017,58.6238774 35.2234886,58.5670466 34.8506085,58.4551825 L32,57.6 Z M32,53.4238774 L36,54.6238774 L36,9.3761226 L32,10.5761226 L32,53.4238774 Z M40,15.0311289 L40,48.9688711 L44,49.4688711 L44,14.5311289 L40,15.0311289 Z M5.32907052e-15,44.4688711 L5.32907052e-15,19.5311289 L3.55271368e-15,44.4688711 Z M4,18.3393899 L4,45.6606101 L28,59.1606101 L28,4.83938994 L4,18.3393899 Z M8,21 L12,19 L12,45 L8,43 L8,21 Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,57 @@
services:
outline:
image: outlinewiki/outline:0.81.0
restart: always
depends_on:
- postgres
- redis
- dex
ports:
- 3000
environment:
NODE_ENV: production
URL: ${URL}
FORCE_HTTPS: 'false'
SECRET_KEY: ${SECRET_KEY}
UTILS_SECRET: ${UTILS_SECRET}
DATABASE_URL: postgres://outline:${POSTGRES_PASSWORD}@postgres:5432/outline
PGSSLMODE: disable
REDIS_URL: redis://redis:6379
OIDC_CLIENT_ID: outline
OIDC_CLIENT_SECRET: ${CLIENT_SECRET}
OIDC_AUTH_URI: ${DEX_URL}/auth
OIDC_TOKEN_URI: ${DEX_URL}/token
OIDC_USERINFO_URI: ${DEX_URL}/userinfo
dex:
image: ghcr.io/dexidp/dex:v2.37.0
restart: always
volumes:
- ../files/etc/dex/config.yaml:/etc/dex/config.yaml
command:
- dex
- serve
- /etc/dex/config.yaml
ports:
- 5556
postgres:
image: postgres:15
restart: always
environment:
POSTGRES_DB: outline
POSTGRES_USER: outline
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data-test-outline-khufpx:/var/lib/postgresql/data
redis:
image: redis:latest
restart: always
command: redis-server --appendonly yes
volumes:
- redis_data-test-outline-khufpx:/data
volumes:
postgres_data-test-outline-khufpx:
redis_data-test-outline-khufpx:

View File

@ -0,0 +1,90 @@
import {
type DomainSchema,
type Schema,
type Template,
generateBase64,
generatePassword,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
const mainDomain = generateRandomDomain(schema);
const dexDomain = generateRandomDomain(schema);
const SECRET_KEY = generateBase64(32);
const UTILS_SECRET = generateBase64(32);
const CLIENT_SECRET = generateBase64(32);
const POSTGRES_PASSWORD = generatePassword();
const mainURL = `http://${mainDomain}`;
const dexURL = `http://${dexDomain}`;
const domains: DomainSchema[] = [
{
host: mainDomain,
port: 3000,
serviceName: "outline",
},
{
host: dexDomain,
port: 5556,
serviceName: "dex",
},
];
const mounts: Template["mounts"] = [
{
filePath: "/etc/dex/config.yaml",
content: `issuer: ${dexURL}
web:
http: 0.0.0.0:5556
storage:
type: memory
enablePasswordDB: true
frontend:
issuer: Outline
logger:
level: debug
staticPasswords:
- email: "admin@example.com"
# bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2)
hash: "$2y$10$jsRWHw54uxTUIfhjgUrB9u8HSzPk7TUuQri9sXZrKzRXcScvwYor."
username: "admin"
userID: "1"
oauth2:
skipApprovalScreen: true
alwaysShowLoginScreen: false
passwordConnector: local
staticClients:
- id: "outline"
redirectURIs:
- ${mainURL}/auth/oidc.callback
name: "Outline"
secret: "${CLIENT_SECRET}"`,
},
];
const envs = [
`URL=${mainURL}`,
`DEX_URL=${dexURL}`,
`DOMAIN_NAME=${mainDomain}`,
`POSTGRES_PASSWORD=${POSTGRES_PASSWORD}`,
`SECRET_KEY=${SECRET_KEY}`,
`UTILS_SECRET=${UTILS_SECRET}`,
`CLIENT_SECRET=${CLIENT_SECRET}`,
];
return {
domains,
envs,
mounts,
};
}

View File

@ -1,6 +1,21 @@
import type { TemplateData } from "./types/templates-data.type";
export const templates: TemplateData[] = [
{
id: "outline",
name: "Outline",
version: "0.81.0",
description:
"Outline is a self-hosted knowledge base and documentation platform that allows you to build and manage your own knowledge base applications.",
links: {
github: "https://github.com/outline/outline",
website: "https://outline.com/",
docs: "https://docs.outline.com/",
},
logo: "outline.svg",
load: () => import("./outline/index").then((m) => m.generate),
tags: ["documentation", "knowledge-base", "self-hosted"],
},
{
id: "supabase",
name: "SupaBase",