Skip to content

Commit 5004a00

Browse files
committed
Release 3.0.0
1 parent 667ef02 commit 5004a00

File tree

10 files changed

+189
-150
lines changed

10 files changed

+189
-150
lines changed

Dockerfile

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
1-
FROM alpine:latest
1+
FROM node:22.9.0-alpine3.20
22

33
ARG PB_VERSION=0.22.21
44
ARG POCKETBASE_ADMIN_EMAIL=admin@example.com
55
ARG POCKETBASE_ADMIN_PASSWORD=admin123
6-
7-
RUN apk add --no-cache \
6+
ARG POCKETBASE_URL=http://127.0.0.1:8080
7+
ARG TITLE=Markopolis
8+
ARG API_KEY=test
9+
ARG CAP1=none
10+
ARG CAP2=none
11+
ARG CAP3=none
12+
13+
# Set environment variables to be overridden at runtime
14+
ENV PB_VERSION=${PB_VERSION}
15+
ENV POCKETBASE_ADMIN_EMAIL=${POCKETBASE_ADMIN_EMAIL}
16+
ENV POCKETBASE_ADMIN_PASSWORD=${POCKETBASE_ADMIN_PASSWORD}
17+
ENV POCKETBASE_URL=${POCKETBASE_URL}
18+
ENV TITLE=${TITLE}
19+
ENV API_KEY=${API_KEY}
20+
ENV CAP1=${CAP1}
21+
ENV CAP2=${CAP2}
22+
ENV CAP3=${CAP3}
23+
24+
# Install required packages
25+
RUN apk update && apk add --no-cache \
826
unzip \
9-
ca-certificates \
1027
curl
1128

1229
# download and unzip PocketBase
@@ -26,7 +43,15 @@ RUN chmod +x /pb/start.sh
2643
# uncomment to copy the local pb_hooks dir into the image
2744
# COPY ./pb_hooks /pb/pb_hooks
2845

29-
EXPOSE 8080
46+
WORKDIR /app
47+
COPY . .
48+
COPY start_services.sh /app/start.sh
49+
50+
RUN npm ci
51+
52+
RUN /pb/start.sh
53+
54+
EXPOSE 3000 8080
3055

3156
# start PocketBase
32-
CMD ["/pb/start.sh"]
57+
CMD ["/bin/sh", "/app/start.sh"]

README.md

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@ open-source and free under the MIT License. Check out the [GitHub repo](https://
1010
**TLDR:** Self-hosted Obsidian publish with an API to extend functionality.
1111

1212
## Features
13-
- **Simple Deployment:** Extremely easy to deploy, configure, and use.
14-
- **REST API Interface:** Provides a REST API to interact with different Markdown elements in your notes.
15-
- **Customizable UI:** Supports "bring your own user interface" by using Markopolis as a backend.
16-
- **Obsidian Markdown Flavor:** Stays close to the Obsidian Markdown flavor and supports backlinks, todos, LaTeX equations, code, tables, callouts etc.
17-
- **Instant Rendering:** Uses a single command to push Markdown notes to the server and instantly renders them as simple webpages.
18-
- **Full Text Search:** Implements full text search.
19-
- **Dark and Light Modes:** Supports both dark and light modes.
20-
- **Low Maintenance:** Requires very little to no maintenance.
21-
- **Docker Support:** Comes as a deployable Docker image.
22-
- **API Documentation:** Inbuilt API documentation generated using FastAPI.
13+
14+
- **Easy setup** Extremely simple to deploy and use
15+
- **Easy publish** Publish notes online with a single command
16+
- **Markdown API interface** Interact with aspecs of markdown using REST APIs
17+
- **Extensible** Extendable using exposed APIs
18+
- **Develop your own frontend** You can use the api calls to get every section of markdown files to design your own frontend
19+
- **Instand rendering** Article is available online as soon as ypu publish
20+
- **Full text search** Fuzzy search across your entire notes vault
21+
- **Obsidian markdown flavor** Maintains compatibility with obsidian markdown syntax. Supports
22+
callouts, equations, code highlighting etc.
23+
- **Dark & Light modes** Supports toggling between light and dark themes
24+
- **Easy maintenance** Requires very little to no maintenance
25+
- **Docker support** Available as docker images to self host
2326

2427
and lots more to come. Checkout the [roadmap](https://markopolis.app/roadmap) page for planned features.
2528

2629
## Demo
27-
The documentation [website](https://markopolis.app) is hosted using Markopolis and showcases a small collection of Markdown notes to highlight the essential features.
28-
I have tried to incorporate content here to showcase different features. Take a look at the [https://markopolis.app/](https://markopolis.app/Markdown%20Syntax) page for
29-
checking out how different markdown syntax is rendered.
30+
The documentation [website](https://markopolis.app) is hosted using Markopolis and is a live demo.
31+
These notes are used to demonstrate the various aspects of Markopolis.
32+
Checkout the [[Markdown Syntax]] page for a full showcase of all supported markdown syntax. checking out how different markdown syntax is rendered.
3033

3134
Thank you for considering Markopolis for your Markdown note-sharing needs! If you like
3235
the project considering starring the repository.
@@ -47,58 +50,77 @@ will always be open-source and maintained as I rely on it for my own notes syste
4750
If you like the project please don't forget to star the [github repo](https://github.com/rishikanthc/markopolis.git).
4851

4952
## Installation
50-
Installing Markopolis involves two steps.
51-
52-
- **STEP 1:** Deploying the Markopolis server
53-
- **STEP 2:** Installing the Markopolis package on your local machine
53+
Installing Markopolis involves two steps. First deploying the server. Second
54+
installing the CLI tool. The CLI tool provides a utility command to upload
55+
your markdown files to the server. The articles are published as soon as
56+
this command is run.
5457

55-
## STEP 1: Deploying Markopolis server
58+
## Server installation
5659

57-
The easiest way to deploy the server is to use the provided docker image.
58-
The docker image packages both the backend and frontend together and sets up a
59-
reverse proxy to route requests correctly to the backend and frontend.
60+
We will be using Docker for deploying Markopolis.
61+
Create a docker-compose and configure environment variables.
62+
Make sure to generate and add a secure `API_KEY`.
63+
Allocate persistent storage for the Markdown files.
6064

61-
You can use the docker-compose provided below. Make sure to change the
62-
environment variables to match your settings.
63-
64-
> [!warning]
65-
> Make sure to use a secure API key. You can use `openssl rand -hex 32` to
66-
> generate a random alphanumeric string to use as your API key.
6765

68-
### Docker Compose
66+
Next create a `docker-compose.yaml` file with the following:
6967

70-
71-
```
68+
```yaml
7269
version: '3.8'
7370

7471
services:
7572
markopolis:
76-
image: ghcr.io/rishikanthc/markopolis:2.0.0
73+
image: ghcr.io/rishikanthc/markopolis:latest
7774
ports:
78-
- "8080:80"
75+
- "8080:8080"
76+
- "3000:3000"
7977
environment:
80-
- MARKOPOLIS_DOMAIN="https://your-domain.com"
81-
- MARKOPOLIS_FRONTEND_URL = https://your-domain.com"
82-
- MARKOPOLIS_TITLE="Awesome Notes"
83-
- MARKOPOLIS_MD_PATH=/app/markdown
84-
- MARKOPOLIS_API_KEY=<really long random alpha-numeric string>
78+
- POCKETBASE_URL=http://127.0.0.1:8080
79+
- API_KEY=test
80+
- POCKETBASE_ADMIN_EMAIL=admin@admin.com
81+
- POCKETBASE_ADMIN_PASSWORD=password
82+
- TITLE=Markopolis
83+
- CAP1=caption1
84+
- CAP2=caption2
85+
- CAP3=caption3
8586
volumes:
86-
- markopolis_data:/app/markdown
87-
restart: unless-stopped
88-
89-
volumes:
90-
markopolis_data:
91-
driver: local
87+
- ./pb_data:/app/pb
9288
```
9389
90+
Now you can deploy Markopolis by running `docker-compse up -d`
9491

9592
Parameter | Description
9693
-- | --
97-
MARKOPOLIS_DOMAIN | This is the domain at which both your frontend and backend is available by default. Make sure to include the protocol along with your domain
98-
MARKOPOLIS_FRONTEND_URL | This parameter is available for configuring custom frontend implementations. If you are using the default front-end that ships with Markopolis, this should be **same as MARKOPOLIS_DOMAIN**.
99-
MARKOPOLIS_TITLE | This parameter controls the site title displayed on the top-left in the header
100-
MARKOPOLIS_MD_PATH | This is the path on the server at which your markdown files are stored. Ideally this should point to a directory in your persistent volume.
101-
MARKOPOLIS_API_KEY | For security, most of the API endpoints are protected by an API key. Make sure to use a secure API key and don't share it publicly.
94+
POCKETBASE_URL | **DO NOT Change this**
95+
POCKETBASE_ADMIN_EMAIL | The admin account email for the database
96+
POCKETBASE_ADMIN_PASSWORD | The admin account password
97+
TITLE | SITE TITLE
98+
API_KEY | For security, most of the API endpoints are protected by an API key. Make sure to use a secure API key and don't share it publicly.
99+
CAP1 | Caption 1, text that appears below the site title
100+
CAP2 | Caption 2
101+
CAP3 | Caption 3
102+
103+
104+
## Local Installation
105+
Requirements: Python 3.12
106+
107+
Install:
108+
```sh
109+
pip install markopolis
110+
```
111+
112+
### Configuration:
113+
Create a config file as a YAML file in any location.
114+
Set the `MARKOPOLIS_CONFIG_PATH` environment variable to point to the location of the config file.
115+
The config file should specify the domain of the deployment including the protocol and
116+
the api key. The api key should be the same as what you used for the deployment:
117+
118+
```yaml
119+
domain: "https://your-domain.com"
120+
```
121+
122+
I recommend using a python virtual environment for the local installation.
123+
102124

103125
> [!warning]
104126
> the domains should not contain a leading slash at the end.
@@ -107,23 +129,18 @@ MARKOPOLIS_API_KEY | For security, most of the API endpoints are protected by an
107129

108130
## STEP 2: Local installation
109131

110-
Markopolis provides an easy way to sync or push your markdown files from your computer to the server.
111-
You do not need to use Docker to mount your markdown files. Follow the instructions below to set this
112-
up.
113-
114-
115132
I highly recommend configuring a virtual environment for python to keep your environment clean and
116133
and prevent any dependency issues. Below I detail the steps to do this using Conda or pip. If you are familar
117134
with this feel free to skip to the package installation section.
118135

119136
> [!info]
120-
> You need to have python version >= 3.11
137+
> You need to have python version >= 3.12
121138

122139
### Setting up a virtual environment
123140

124141
You can use either `pip` or `conda` to do this. If you are using `pip` simply run
125142
```bash
126-
python3.11 -m venv <name>
143+
python3.12 -m venv <name>
127144
```
128145

129146
Replace `<name>` with your desired virtual environment name. You can then activate the virtual environment
@@ -134,7 +151,7 @@ source <name>
134151

135152
For conda, you can use
136153
```bash
137-
conda create -n <name> python==3.11
154+
conda create -n <name> python==3.12
138155
```
139156

140157
and activate it with
@@ -153,40 +170,31 @@ pip install markopolis
153170

154171
### Configuration
155172

156-
Create a yaml config file anywhere in your system to set the below values. I recommend
157-
storing it in `.config/markopolis/settings.yaml`.
158-
159-
> [!info]
160-
> You can name the file anything and you can store it anywhere.
161-
> You will need to set the config path for Markopolis to read the config file correctly.
162-
163-
Point markopolis to your config file by setting the `MARKOPOLIS_CONFIG_PATH` to the location
164-
of your yaml file. You can also add it to your shell config so it persists across sessions.
165-
173+
Set the environment variables `MARKOPOLIS_DOMAIN` and `MARKOPOLIS_API`
166174

167175
**bash or zsh (temporarily for current session)**
168176
```bash
169-
export MARKOPOLIS_CONFIG_PATH=/path/to/settings.yaml
177+
export MARKOPOLIS_DOMAIN=https://markopolis.example.com
170178
```
171179

172180
**bash or zsh (permanently for all sessions)**
173181
```bash
174-
echo 'export MARKOPOLIS_CONFIG_PATH=/path/to/settings.yaml' >> ~/.zshrc
175-
echo 'export MARKOPOLIS_CONFIG_PATH=/path/to/settings.yaml' >> ~/.bashrc
182+
echo 'export MARKOPOLIS_DOMAIN=https://markopolis.example.com' >> ~/.zshrc
183+
echo 'export MARKOPOLIS_DOMAIN=https://markopolis.example.com' >> ~/.bashrc
176184
177185
source ~/.zshrc
178186
source ~/.bashrc
179187
```
180188

181189
**fish (temporarily for current session)**
182190
```fish
183-
set -x MARKOPOLIS_CONFIG_PATH /path/to/settings.yaml
191+
set -x MARKOPOLIS_DOMAIN https://markopolis.example.com
184192
```
185193

186194

187195
**fish (permanently for all sessions)**
188196
```fish
189-
echo 'set -x MARKOPOLIS_CONFIG_PATH "/path/to/settings.yaml"' >> ~/.config/fish/config.fish
197+
echo 'set -x MARKOPOLIS_DOMAIN "https://markopolis.example.com"' >> ~/.config/fish/config.fish
190198
source ~/.config/fish/config.fish
191199
```
192200

docker-compose.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
version: '3.8'
22

33
services:
4-
sveltekit-pocketbase:
5-
image: local-sveltekit-pocketbase:test
4+
markopolis:
5+
image: ghcr.io/rishikanthc/markopolis:3.0.0
66
ports:
77
- "8080:8080"
8+
- "3000:3000"
89
environment:
9-
- POCKETBASE_URL=http://localhost:8080
10-
- API_KEY=compose-runtime-key
11-
- POCKETBASE_ADMIN_EMAIL=admin@example.com
12-
- POCKETBASE_ADMIN_PASSWORD=123
13-
- TITLE=Compose Runtime App
10+
- POCKETBASE_URL=http://127.0.0.1:8080
11+
- API_KEY=test
12+
- POCKETBASE_ADMIN_EMAIL=admin@admin.com
13+
- POCKETBASE_ADMIN_PASSWORD=password
14+
- TITLE=Markopolis
15+
- CAP1=Markdown
16+
- CAP2="Self-hosted"
17+
- CAP3="Knowledge Garden"
1418
volumes:
15-
- ./pb_data:/app/pb_data
19+
- ./pb_data:/app/pb

docs/installation.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@ TITLE=Markopolis
3131
Next create a `docker-compose.yaml` file with the following:
3232
3333
```yaml
34+
version: '3.8'
35+
3436
services:
35-
markopolis:
36-
image: ghcr.io/rishikanthc/markopolis:0.2.0
37+
sveltekit-pocketbase:
38+
image: ghcr.io/rishikanthc/markopolis:latest
3739
ports:
38-
- "8090:8090" # optional
40+
- "8080:8080"
3941
- "3000:3000"
40-
env_file:
41-
.env
4242
environment:
43-
- API_KEY=<long random string>
44-
- POCKETBASE_ADMIN_EMAIL=example@example.com
43+
- POCKETBASE_URL=http://127.0.0.1:8080
44+
- API_KEY=test
45+
- POCKETBASE_ADMIN_EMAIL=admin@admin.com
4546
- POCKETBASE_ADMIN_PASSWORD=password
4647
- TITLE=Markopolis
4748
volumes:
48-
- markopolis_data:/app/db
49-
restart: unless-stopped
49+
- ./pb_data:/app/pb
50+
5051
```
5152
5253
Now you can deploy Markopolis by running `docker-compse up -d`

0 commit comments

Comments
 (0)