Skip to content

Commit ba54124

Browse files
authored
Merge pull request #1321 from drudge/templates/outline
feat(template): add outline
2 parents 64bdf07 + 9ace0f3 commit ba54124

File tree

5 files changed

+165
-2
lines changed

5 files changed

+165
-2
lines changed

apps/dokploy/pages/dashboard/project/[projectId].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ import type {
7070
} from "next";
7171
import Head from "next/head";
7272
import { useRouter } from "next/router";
73-
import { useMemo, useState, type ReactElement } from "react";
74-
import superjson from "superjson";
73+
import { type ReactElement, useMemo, useState } from "react";
7574
import { toast } from "sonner";
75+
import superjson from "superjson";
7676

7777
export type Services = {
7878
appName: string;
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
services:
2+
outline:
3+
image: outlinewiki/outline:0.81.0
4+
restart: always
5+
depends_on:
6+
- postgres
7+
- redis
8+
- dex
9+
ports:
10+
- 3000
11+
environment:
12+
NODE_ENV: production
13+
URL: ${URL}
14+
FORCE_HTTPS: 'false'
15+
SECRET_KEY: ${SECRET_KEY}
16+
UTILS_SECRET: ${UTILS_SECRET}
17+
DATABASE_URL: postgres://outline:${POSTGRES_PASSWORD}@postgres:5432/outline
18+
PGSSLMODE: disable
19+
REDIS_URL: redis://redis:6379
20+
OIDC_CLIENT_ID: outline
21+
OIDC_CLIENT_SECRET: ${CLIENT_SECRET}
22+
OIDC_AUTH_URI: ${DEX_URL}/auth
23+
OIDC_TOKEN_URI: ${DEX_URL}/token
24+
OIDC_USERINFO_URI: ${DEX_URL}/userinfo
25+
26+
dex:
27+
image: ghcr.io/dexidp/dex:v2.37.0
28+
restart: always
29+
volumes:
30+
- ../files/etc/dex/config.yaml:/etc/dex/config.yaml
31+
command:
32+
- dex
33+
- serve
34+
- /etc/dex/config.yaml
35+
ports:
36+
- 5556
37+
38+
postgres:
39+
image: postgres:15
40+
restart: always
41+
environment:
42+
POSTGRES_DB: outline
43+
POSTGRES_USER: outline
44+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
45+
volumes:
46+
- postgres_data-test-outline-khufpx:/var/lib/postgresql/data
47+
48+
redis:
49+
image: redis:latest
50+
restart: always
51+
command: redis-server --appendonly yes
52+
volumes:
53+
- redis_data-test-outline-khufpx:/data
54+
55+
volumes:
56+
postgres_data-test-outline-khufpx:
57+
redis_data-test-outline-khufpx:
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import {
2+
type DomainSchema,
3+
type Schema,
4+
type Template,
5+
generateBase64,
6+
generatePassword,
7+
generateRandomDomain,
8+
} from "../utils";
9+
10+
export function generate(schema: Schema): Template {
11+
const mainDomain = generateRandomDomain(schema);
12+
const dexDomain = generateRandomDomain(schema);
13+
const SECRET_KEY = generateBase64(32);
14+
const UTILS_SECRET = generateBase64(32);
15+
const CLIENT_SECRET = generateBase64(32);
16+
const POSTGRES_PASSWORD = generatePassword();
17+
18+
const mainURL = `http://${mainDomain}`;
19+
const dexURL = `http://${dexDomain}`;
20+
21+
const domains: DomainSchema[] = [
22+
{
23+
host: mainDomain,
24+
port: 3000,
25+
serviceName: "outline",
26+
},
27+
{
28+
host: dexDomain,
29+
port: 5556,
30+
serviceName: "dex",
31+
},
32+
];
33+
34+
const mounts: Template["mounts"] = [
35+
{
36+
filePath: "/etc/dex/config.yaml",
37+
content: `issuer: ${dexURL}
38+
39+
web:
40+
http: 0.0.0.0:5556
41+
42+
storage:
43+
type: memory
44+
45+
enablePasswordDB: true
46+
47+
frontend:
48+
issuer: Outline
49+
50+
logger:
51+
level: debug
52+
53+
staticPasswords:
54+
- email: "[email protected]"
55+
# bcrypt hash of the string "password": $(echo password | htpasswd -BinC 10 admin | cut -d: -f2)
56+
hash: "$2y$10$jsRWHw54uxTUIfhjgUrB9u8HSzPk7TUuQri9sXZrKzRXcScvwYor."
57+
username: "admin"
58+
userID: "1"
59+
60+
61+
oauth2:
62+
skipApprovalScreen: true
63+
alwaysShowLoginScreen: false
64+
passwordConnector: local
65+
66+
staticClients:
67+
- id: "outline"
68+
redirectURIs:
69+
- ${mainURL}/auth/oidc.callback
70+
name: "Outline"
71+
secret: "${CLIENT_SECRET}"`,
72+
},
73+
];
74+
75+
const envs = [
76+
`URL=${mainURL}`,
77+
`DEX_URL=${dexURL}`,
78+
`DOMAIN_NAME=${mainDomain}`,
79+
`POSTGRES_PASSWORD=${POSTGRES_PASSWORD}`,
80+
`SECRET_KEY=${SECRET_KEY}`,
81+
`UTILS_SECRET=${UTILS_SECRET}`,
82+
`CLIENT_SECRET=${CLIENT_SECRET}`,
83+
];
84+
85+
return {
86+
domains,
87+
envs,
88+
mounts,
89+
};
90+
}

apps/dokploy/templates/templates.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import type { TemplateData } from "./types/templates-data.type";
22

33
export const templates: TemplateData[] = [
4+
{
5+
id: "outline",
6+
name: "Outline",
7+
version: "0.81.0",
8+
description:
9+
"Outline is a self-hosted knowledge base and documentation platform that allows you to build and manage your own knowledge base applications.",
10+
links: {
11+
github: "https://github.com/outline/outline",
12+
website: "https://outline.com/",
13+
docs: "https://docs.outline.com/",
14+
},
15+
logo: "outline.svg",
16+
load: () => import("./outline/index").then((m) => m.generate),
17+
tags: ["documentation", "knowledge-base", "self-hosted"],
18+
},
419
{
520
id: "supabase",
621
name: "SupaBase",

0 commit comments

Comments
 (0)