Logseq is A privacy-first, open-source platform for knowledge sharing and management.
The GitHub integration is deprecated, we’re not going to accept any PRs.
If you’re on Windows, use the Windows setup.
Follow the guide at
https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app,
where the user authorization “Callback URL” should be
http://localhost:3000/auth/github
.
Remember to download the private-key.pem
which will be used for the
next step. Also take note of your App ID
, Client ID
, and your newly
generated Client Secret
for use in step 4.
Make sure you have PostgreSQL running. You can check if it’s running
with pg_ctl -D /usr/local/var/postgres status
and use
pg_ctl -D /usr/local/var/postgres start
to start it up. You’ll also
need to make a Logseq DB in PostgreSQL. Do that with createdb logseq
.
export ENVIRONMENT="dev"
export JWT_SECRET="xxx"
export COOKIE_SECRET="xxx"
export DATABASE_URL="postgresql://your-user:your-password@localhost:5432/logseq"
export GITHUB_APP2_NAME="your github app name"
export GITHUB_APP2_ID="your app id"
export GITHUB_APP2_KEY="you client id"
export GITHUB_APP2_SECRET="your secret"
export GITHUB_REDIRECT_URI="http://localhost:3000/auth/github"
# Replace your-code-directory with yours
export GITHUB_APP_PEM="/your-code-directory/logseq/pem/logseq-test.2020-08-27.private-key.pem"
export GOOGLE_APP_KEY="your key"
export GOOGLE_APP_SECRET="your secret"
export GOOGLE_REDIRECT_URI="http://localhost:3000/auth/google"
export LOG_PATH="/tmp/logseq"
export WEBSITE_URL="http://localhost:3000"
export COOKIE_DOMAIN="localhost"
export AWS_ACCESS_KEY_ID="your key id"
export AWS_SECRET_ACCESS_KEY="your secret"
export AWS_PK_PATH="/your/pk.pem"
export AWS_KEY_PAIR_ID="your key pair id"
export AWS_REGION="us-west-1"
1. C-c M-j and select "clojure-cli" 2. input "(go)" in the clojure repl
(Note: to specify an alias from within emacs you can follow either option suggested here)
1. clj -A:dev 2. input "(go)" in the clojure repl
1. Issue the command Start a REPL server and Connect: ctrl+alt+c ctrl+alt+j 2. Select clojure-cli 3. input "(go)" in the clojure repl
cd web
yarn
yarn watch
open http://localhost:3000
Install clojure through scoop-clojure: https://github.com/littleli/scoop-clojure. You can also install Node.js, Yarn and PostgreSQL through scoop if you want to.
Make sure you have PostgreSQL running. You can check if it’s running with pg_ctl status
and use pg_ctl start
to start it up.
You’ll also need to make a logseq DB in PostgreSQL. Do that with createdb logseq
.
Download this little script that sets up the environment variables and runs cmd-clj -A:dev
.
The GITHUB_APP_PEM
variable in the script needs to be set with the correct directory for your system.
Run that script in the repo and enter (go)
into the interpreter.
Either run cmd-clojure -A:cljs watch app
instead of yarn watch
in the next step or modify web/package.json to use cmd-clojure instead of clojure in the scripts section.
Open command prompt in the repo and do:
cd web
yarn
yarn watch
Wait for it to compile and open localhost:3000
.
- The clojure deps should be synced between the two files:
project.clj
anddeps.edn
. We need theproject.clj
because it’s used for dokku deployment. - To use github push, comment this line https://github.com/tiensonqin/logseq/blob/master/web/src/main/frontend/handler.cljs#L751