• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
  • Created almost 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A guide to deploy logseq.com

Reference: https://github.com/logseq/logseq/tree/defclass/electron#set-up-development-environment

Prerequisites

  1. Make sure all requirements listed at https://github.com/logseq/logseq/tree/defclass/electron#1-requirements are met

  2. Install PostgreSQL create a DB called "logseq" and a user with SUPERUSER permissions

  3. Install nginx & Certbot on your sever

  4. Create GitHub application as discribed in https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app in the App set the Homepage URL to https://yourdomain.com - call back URL to https://yourdomain.com/auth/github Create a "client secret" & a "Private Key" for your app in app permissions set "Contents" access to "read and Write" Copy from your app

    • App ID
    • Client ID
    • Client Secret upload the pem file that was automatically downloaded when you created your app "Private Key" to your sever

Running LogSeq

  1. Clone the logseq repo git clone https://github.com/logseq/logseq
  2. Download backend.jar from https://github.com/logseq/logseq/releases/tag/0.0.1-100 and place it in ~/logsec/resources
  3. In ~/logseq/src/main/frontend/config.cljs line 18 replace
(def website
  (if dev?
    "http://localhost:3000"
    (util/format "https://%s.com" app-name)))

by

(def website
  (if dev?
    "http://localhost:3000"
    "https://yourdomain.com"))

line 38 replace

(def github-app-name (if dev? GITHUB_APP_NAME "logseq"))

by

(def github-app-name (if dev? GITHUB_APP_NAME "yourappname"))
  1. Set the envrionment variables
export GITHUB_REDIRECT_URI="https://yourdomain.com/auth/github"
export ENVIRONMENT="production"
export JWT_SECRET="somepass"
export COOKIE_SECRET="54676c2c5324279480a6ee1af0792588"
export GITHUB_APP2_NAME="yourappname"
export GITHUB_APP2_ID="appID"
export GITHUB_APP2_KEY="AppClientID"
export GITHUB_APP2_SECRET="AppClientSecret"
export GITHUB_APP_PEM="/path/to/github/pem/file/yourappname.2021-01-19.private-key.pem"
export LOG_PATH="/tmp/logseq"
export DATABASE_URL="postgres://localhost:5432/logseq"
export PG_USERNAME="username"
export PG_PASSWORD="password"
export WEBSITE_URL="https://yourdomain.com/"
export COOKIE_DOMAIN="yourdomain.com"
  1. switch to ~/logsec and run yarn then, compile using yarn release
  2. run from ~/logsec using java -Duser.timezone=UTC -jar ./static/logseq.jar

Publishing LogSeq

Now we need to "server" your self hosted logseq to the internet to do that

  1. Create 2 DNS records domain.com & asset.domain.com & get a certificate for each using [[Certbot]]
  2. configure Nginx to
  • rewrite 'asset.logseq.com' to 'asset.domain.com';
  • rewrite 'logseq.com' to 'domain.com';
  • reverse proxy requests to 'domain.com' to 'logseq.jar' (http://localhost:3000)
  • serve 'asset.domain.com' to /path/to/logseq/public/

A dummy copy of the ngix.conf file can be found here

Hardcoded values

shadow-cljs.edn: line 16

    :release {:asset-path "https://asset.logseq.com/static/js"}

src/main/frontend/config.cljs: line 17

  (def app-name "logseq")

src/main/frontend/config.cljs: line 18-21

(def website
(if dev?
  "http://localhost:3000"
  (util/format "https://%s.com" app-name)))

src/main/frontend/config.cljs: line 28

(def asset-domain (util/format "https://asset.%s.com"
 app-name))

logseq.jar/static/js/publishing/cljs-runtime: line 34

frontend.config.app_name = "logseq";

logseq.jar/static/js/publishing/cljs-runtime: line 34

frontend.config.website = (cljs.core.truth_(frontend.config.dev_QMARK_)?"http://localhost:3000":frontend.util.format.cljs$core$IFn$_invoke$arity$variadic("https://%s.com",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([frontend.config.app_name], 0)));

logseq.jar/static/js/publishing/cljs-runtime: line 36

frontend.config.asset_domain = frontend.util.format.cljs$core$IFn$_invoke$arity$variadic("https://asset.%s.com",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([frontend.config.app_name], 0));

logseq.jar/static/js/cljs-runtime/frontend.config.js: line 34

frontend.config.app_name = "logseq";

logseq.jar/static/js/cljs-runtime/frontend.config.js: line 34

frontend.config.website = (cljs.core.truth_(frontend.config.dev_QMARK_)?"http://localhost:3000":frontend.util.format.cljs$core$IFn$_invoke$arity$variadic("https://%s.com",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([frontend.config.app_name], 0)));

logseq.jar/static/js/cljs-runtime/frontend.config.js: line 36

frontend.config.asset_domain = frontend.util.format.cljs$core$IFn$_invoke$arity$variadic("https://asset.%s.com",cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([frontend.config.app_name], 0));

More Repositories

1

react-ecs

An entity-component-system for React
TypeScript
104
star
2

linkmarks

Emacs bookmarks that can be any org-mode link-type!
Emacs Lisp
35
star
3

dotfiles

Nix configuration for all my workstations and servers
JavaScript
32
star
4

eyeliner

Makeup for your mode-line
HTML
32
star
5

dadren

A data-driven game engine for Nim
Nim
19
star
6

pin

A set of Python scripts for helping manage projects on the commandline
Python
17
star
7

org-spacer.el

Enforce the number of blank lines between elements in an org-mode document
Emacs Lisp
15
star
8

emacs-nougat

Modular Emacs configuration amenable to collaboration!
Emacs Lisp
13
star
9

polybrain.el

Polymode support for Org-brain
Emacs Lisp
13
star
10

console

Graphical Docker client in your terminal
Python
12
star
11

hades

Discord bot framework ontop Inversify.js and Discord.js
TypeScript
11
star
12

helm-org-walk

Helpful elisp functions for working with Org OLP paths
Emacs Lisp
10
star
13

capn

capn allows you to specify hooks when changing directories
Python
10
star
14

loom

A Twisted/Fabric based centralized task-scheduler for clusters
Python
10
star
15

tower-of-babix

Run snippets for many languages with Emacs and Nix
Emacs Lisp
7
star
16

Chibot-Ultra-Battle

Historic popular AOL chatroom battle-bot
Visual Basic
7
star
17

jrpc

JSON RPC WebSocket server for Twisted
Python
7
star
18

vcv-svghelper

Determine where your widgets are dynamically.
CMake
7
star
19

vcv-prefabs

Quick patch prefabs and modules for VCV Rack.
C++
6
star
20

fvtt-palantiri

A websocket-client proxy for Foundry VTT
TypeScript
6
star
21

deflayer.el

Easily create layers of Emacs configuration overrides
Emacs Lisp
6
star
22

t3sketch

A TADS 3 prototyping and build system
Python
6
star
23

baduk.nix

Nix Home-Manager modules for playing Go/Baduk
Nix
6
star
24

sutysisku.el

Lojban dictionary for Emacs
Emacs Lisp
5
star
25

vcv-minilab3

C++
5
star
26

pw10-wabble

A simple arcade game where you avoid lasers and get powerups.
Python
5
star
27

dustinlacewell-dotfiles

A repository of my personal linux environment dotfiles
Emacs Lisp
5
star
28

CMLFS

F# translated code examples from Concurrent Programming in ML by John Reppy
F#
5
star
29

spidersilk

A declarative configuration format for specifying hosted twisted.web resources
Python
5
star
30

recap

A simple screen recorder and capture tool.
Python
4
star
31

deconf

An object system for building declarative configurations in Python
Python
4
star
32

ttycaster

A Docker container for running ttycast
Shell
4
star
33

pin-paver

A set of Paver plugins for pin
Python
4
star
34

RuntimeInspector

A runtime inspector for unity games
C#
3
star
35

eater-experiment

An experiment applying genetic algorithms to finite state machines
Python
3
star
36

flapper

A flexible alternative to GraphQL for Gatsby
TypeScript
3
star
37

home-manager-helper

Shell
3
star
38

pw11-prismbreak

my pyweek 11 entry
Python
3
star
39

pin-fabric

Plugins for using fabric with pin
Python
3
star
40

pin-venv

A set of VirtualEnv plugins for pin
Python
3
star
41

shader-learning

Just a throw-away repo for shader toys
Python
3
star
42

jin

Bukkit plugin DI with Google Guice
Java
2
star
43

PySession

A semi-secure Python REPL for IRC
Python
2
star
44

Ultra-Relay-Battle

Fast paced character based in your face brawler for IRC
Python
2
star
45

hera

Stack-based elisp API for Hydra
Emacs Lisp
2
star
46

pw8-lawnorder

Pyweek 5 - "Get off my lawn!" : Lawn and Order is a simple game where two players compete to destory their neighbor's lawn.
Python
2
star
47

MultiMod

BepInEx mod which can load multiple assetbundle+code mods
C#
2
star
48

pin-pip

Enables pin to work with pip
Python
2
star
49

org-ls

Org-mode Life Support
Emacs Lisp
2
star
50

pretty-hydra

A fork of pretty-hydra from https://github.com/jerrypnz/major-mode-hydra.el
Emacs Lisp
2
star
51

BindingAttributes

Attributes for binding types in the Microsoft.Extensions.DependencyInjection container
C#
2
star
52

pw5-murmel

Pyweek 5 - Twisted : Murmel is a simple collect-a-thon in a rotating maze.
Python
2
star
53

optionbag

A Python data-structure suited for representing options
1
star
54

the-index

Python
1
star
55

multivac

A LLM chat UI
TypeScript
1
star
56

docusaurus-typescript

Example of non-working Docusaurus monorepo
JavaScript
1
star
57

blot

An unassuming static-site generator for Python
Python
1
star
58

hades-example-bot

An example bot using the Hades Discord bot framework
TypeScript
1
star
59

react-ecs-demo

Simple create-react-app demo showcasing minimal use of React ECS
TypeScript
1
star
60

hades-text-commands

Text command support for Hades
TypeScript
1
star
61

SafeManifest

A module for using Python scripts for config files
1
star
62

tsgo

A TypeScript Goban for the web.
TypeScript
1
star
63

hades-slash-commands

Slash command support for Hades
Nix
1
star
64

pw9-darkpastel

Pyweek 9 - Feather : Dark Pastel is a side-scrolling arcade game, where you hide in flocks for cover.
Python
1
star
65

UltraRelayBattle

A realtime text-based arena brawler
TypeScript
1
star
66

golang-emacs

Standalone Emacs configuration for Golang
Shell
1
star
67

chatwith

Ink based chat-gpt interface
TypeScript
1
star
68

Distillery

Distillations of articles on Western Philosophy
1
star
69

auto-survivors

A multiplayer clone of Vampire Survivors
TypeScript
1
star
70

nix

A small arcade game built with Nim and SDL
Nim
1
star
71

plait

A utility for executing commands against remote SSH hosts in parallel
Python
1
star
72

emacs.d

dustinlacewell's Emacs configuration
1
star
73

true

Small dockerfile project for testing
Assembly
1
star
74

matched-line-dimmer-vsix

Visually dim lines that match configured regex patterns in VSCode.
TypeScript
1
star
75

kantgen

A recursive template-grammar library for Python for procedurally generated text
Python
1
star
76

categoric-decorators

Decorate things. Find them at runtime.
TypeScript
1
star
77

tadslite

A simple project template for TADS3 / Adv3Lite
Perl
1
star
78

pw6-celldoku

Pyweek 5 - Robot : Celldoku is a puzzle game based of Conway's Game of Life
1
star
79

chipper

Refreshingly simple declarative logging that utilizes arbitrary tag sinks instead of traditional level handling
Python
1
star
80

ttybin

A new pastebin for script/ttyrec terminal recordings
JavaScript
1
star
81

CozyCampfires2

Remake of CozyCampfires for S.T.A.L.K.E.R. Anomaly
1
star
82

hatchet

A wilderness survival roguelike built with ES6 and Phaser
JavaScript
1
star