Skip to content

Commit 1a8d714

Browse files
authored
Merge pull request #141 from tecc/main
Multiple changes
2 parents 6253d84 + 7c57353 commit 1a8d714

File tree

172 files changed

+8747
-7875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+8747
-7875
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["next/babel"],
3-
"plugins": ["lodash"]
2+
"presets": ["next/babel"],
3+
"plugins": ["lodash"]
44
}

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.git
33
.next
44
.vercel
5+
node_modules
6+
.dev

.eslintrc.json

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,56 @@
11
{
2-
"parser": "@typescript-eslint/parser",
3-
"plugins": ["@typescript-eslint"],
4-
"extends": [
5-
"eslint:recommended",
6-
"plugin:react/recommended",
7-
"plugin:react-hooks/recommended",
8-
"plugin:@typescript-eslint/recommended"
9-
// Uncomment the following lines to enable eslint-config-prettier
10-
// Is not enabled right now to avoid issues with the Next.js repo
11-
// "prettier",
12-
// "prettier/@typescript-eslint"
13-
],
14-
"env": {
15-
"es6": true,
16-
"browser": true,
17-
"jest": true,
18-
"node": true
19-
},
20-
"settings": {
21-
"react": {
22-
"version": "detect"
23-
}
24-
},
25-
"rules": {
26-
"react/react-in-jsx-scope": 0,
27-
"react/display-name": 0,
28-
"react/prop-types": 0,
29-
"@typescript-eslint/explicit-function-return-type": 0,
30-
"@typescript-eslint/explicit-module-boundary-types": 0,
31-
"@typescript-eslint/explicit-member-accessibility": 0,
32-
"@typescript-eslint/indent": 0,
33-
"@typescript-eslint/member-delimiter-style": 0,
34-
"@typescript-eslint/no-explicit-any": 0,
35-
"@typescript-eslint/no-var-requires": 0,
36-
"@typescript-eslint/no-use-before-define": 0,
37-
"@typescript-eslint/no-unused-vars": [
38-
2,
39-
{
40-
"argsIgnorePattern": "^_"
41-
}
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint"],
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:react/recommended",
7+
"plugin:react-hooks/recommended",
8+
"plugin:@typescript-eslint/recommended"
9+
// Uncomment the following lines to enable eslint-config-prettier
10+
// Is not enabled right now to avoid issues with the Next.js repo
11+
// "prettier",
12+
// "prettier/@typescript-eslint"
4213
],
43-
"no-console": "off"
44-
}
14+
"env": {
15+
"es6": true,
16+
"browser": true,
17+
"jest": true,
18+
"node": true
19+
},
20+
"settings": {
21+
"react": {
22+
"version": "detect"
23+
}
24+
},
25+
"rules": {
26+
"arrow-parens": "warn",
27+
"indent": [
28+
"warn",
29+
4,
30+
{
31+
"SwitchCase": 1
32+
}
33+
],
34+
"semi": "warn",
35+
"object-curly-spacing": ["warn", "always"],
36+
"react/react-in-jsx-scope": 0,
37+
"react/display-name": 0,
38+
"react/prop-types": 0,
39+
"@typescript-eslint/explicit-function-return-type": 0,
40+
"@typescript-eslint/explicit-module-boundary-types": 0,
41+
"@typescript-eslint/explicit-member-accessibility": 0,
42+
"@typescript-eslint/indent": 0,
43+
"@typescript-eslint/member-delimiter-style": 0,
44+
"@typescript-eslint/no-explicit-any": 0,
45+
"@typescript-eslint/no-var-requires": 0,
46+
"@typescript-eslint/no-use-before-define": 0,
47+
"@typescript-eslint/no-inferrable-types": 0,
48+
"@typescript-eslint/no-unused-vars": [
49+
2,
50+
{
51+
"argsIgnorePattern": "^_"
52+
}
53+
],
54+
"no-console": "off"
55+
}
4556
}

.github/pull.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '1'
22
rules:
3-
- base: main
4-
upstream: qingwei-li:main
5-
mergeMethod: hardreset
3+
- base: main
4+
upstream: qingwei-li:main
5+
mergeMethod: hardreset

.github/workflows/docker-publish.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@ name: Publish Docker
33
on: [push]
44

55
jobs:
6-
# test:
7-
# name: Test
8-
# runs-on: ubuntu-latest
9-
# steps:
10-
# - uses: actions/checkout@v2
11-
# - name: Install modules
12-
# run: yarn
13-
# - name: Run MinIO
14-
# run: docker-compose up -d
15-
# - name: Run tests
16-
# run: yarn test
17-
publish:
18-
name: Publish
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@master
22-
- name: Docker meta
23-
id: meta
24-
uses: crazy-max/ghaction-docker-meta@v2
25-
with:
26-
images: cinwell/notea
27-
tags: |
28-
type=ref,event=branch
29-
type=ref,event=pr
30-
type=semver,pattern={{version}}
31-
type=semver,pattern={{major}}.{{minor}}
32-
- uses: mstachniuk/ci-skip@v1
33-
with:
34-
fail-fast: true
35-
- name: Set up QEMU
36-
uses: docker/setup-qemu-action@v1
37-
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@v1
39-
- name: Login to DockerHub
40-
uses: docker/login-action@v1
41-
with:
42-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
43-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
44-
- name: Build and push
45-
uses: docker/build-push-action@v2
46-
with:
47-
context: .
48-
platforms: linux/amd64,linux/arm64
49-
push: ${{ github.event_name != 'pull_request' }}
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
6+
# test:
7+
# name: Test
8+
# runs-on: ubuntu-latest
9+
# steps:
10+
# - uses: actions/checkout@v2
11+
# - name: Install modules
12+
# run: yarn
13+
# - name: Run MinIO
14+
# run: docker-compose up -d
15+
# - name: Run tests
16+
# run: yarn test
17+
publish:
18+
name: Publish
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@master
22+
- name: Docker meta
23+
id: meta
24+
uses: crazy-max/ghaction-docker-meta@v2
25+
with:
26+
images: cinwell/notea
27+
tags: |
28+
type=ref,event=branch
29+
type=ref,event=pr
30+
type=semver,pattern={{version}}
31+
type=semver,pattern={{major}}.{{minor}}
32+
- uses: mstachniuk/ci-skip@v1
33+
with:
34+
fail-fast: true
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v1
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v1
39+
- name: Login to DockerHub
40+
uses: docker/login-action@v1
41+
with:
42+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
43+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
44+
- name: Build and push
45+
uses: docker/build-push-action@v2
46+
with:
47+
context: .
48+
platforms: linux/amd64,linux/arm64
49+
push: ${{ github.event_name != 'pull_request' }}
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ yarn-error.log*
3131
.env.test.local
3232
.env.production.local
3333

34+
# Developer files
35+
.dev/
36+
3437
# vercel
3538
.vercel
3639
/public/workbox-*.js*
3740
/public/sw.js*
41+
42+
# Editor files
43+
# - IntelliJ IDEA
44+
.idea/
45+
*.iml

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/.git
2+
**/.svn
3+
**/.hg
4+
**/node_modules
5+
.next/
6+
.idea/
7+
.dev/

.prettierrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2-
"semi": false,
3-
"singleQuote": true
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 4,
5+
"useTabs": false,
6+
"arrowParens": "always",
7+
"bracketSpacing": true
48
}

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Building the code
2-
FROM node:lts-alpine AS builder
2+
FROM node:16-alpine AS builder
33

44
WORKDIR /app
55

@@ -14,7 +14,7 @@ RUN yarn install --production --frozen-lockfile
1414

1515

1616
# Stage 2: And then copy over node_modules, etc from that stage to the smaller base image
17-
FROM node:lts-alpine as production
17+
FROM node:16-alpine as production
1818

1919
WORKDIR /app
2020

@@ -23,6 +23,11 @@ COPY --from=builder /app/public ./public
2323
COPY --from=builder /app/.next ./.next
2424
COPY --from=builder /app/node_modules ./node_modules
2525

26+
VOLUME /app/config
27+
# VOLUME /app/data
28+
29+
ENV CONFIG_FILE=/app/config/notea.yml
30+
2631
EXPOSE 3000
2732

2833
CMD ["node_modules/.bin/next", "start"]

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
1-
# The [logseq](https://logseq.com/) is the better choice, and you can sync data via Google Drive and Syncthing. I'm using this right now.
2-
3-
----------
4-
51
# Notea
62

7-
> Self hosted note taking app stored on S3.
3+
> Self-hosted note-taking app stored on S3.
84
9-
![screenshot](https://cdn.statically.io/gh/QingWei-Li/notea/gh-pages/screen.png)
5+
![screenshot](https://cdn.statically.io/gh/notea-org/notea/gh-pages/screen.png)
106

117
<a href="https://www.producthunt.com/posts/notea?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-notea" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=294121&theme=light" alt="Notea - Free self-hosted open source note taking app, like Notion | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
128

139
## Features
1410

15-
- One-click deploy to Vercel/Netlify or deploy to host with Docker
16-
- Support storage in Amazon S3, MinIO, Aliyun OSS, etc
17-
- Notion like markdown editor
18-
19-
## Demo
20-
21-
- Link: https://notea.cinwell.com
11+
- One-click deploy to Vercel/Netlify or deploy to host with Docker
12+
- Support storage in Amazon S3, MinIO, Aliyun OSS, etc
13+
- Notion-like markdown editor
2214

2315
## Roadmap
2416

25-
- [x] Backlinks [#39](https://github.com/QingWei-Li/notea/issues/39)
26-
- [x] Link embed(Youtube, Github Gist, Google Docs, etc.)
27-
- [ ] Editing offline [#14](https://github.com/QingWei-Li/notea/issues/14)
28-
- [ ] Note versioning [#49](https://github.com/QingWei-Li/notea/issues/49)
29-
- [ ] File upload
17+
- [x] Backlinks [#39](https://github.com/notea-org/notea/issues/39)
18+
- [x] Link embedding (YouTube, Github Gist, Google Docs, etc.)
19+
- [ ] Editing offline [#14](https://github.com/notea-org/notea/issues/14)
20+
- [ ] Note versioning [#49](https://github.com/notea-org/notea/issues/49)
21+
- [ ] File upload
3022

3123
## Quickstart
3224

33-
1. Fork repo. It is recommended to install the **[<img src="https://prod.download/pull-18h-svg" valign="bottom"/> Pull app](https://github.com/apps/pull)** for automatic synchronization.
34-
1. [Choose Storage](#storage) and **manually create bucket**.
35-
1. [Deploy App](#deploy)
25+
1. Fork repo. It is recommended to install the
26+
**[<img src="https://prod.download/pull-18h-svg" valign="bottom"/> Pull app](https://github.com/apps/pull)**
27+
for automatic synchronization.
28+
2. [Choose Storage](#storage) and **manually create bucket**.
29+
3. [Deploy App](#deploy)
3630

3731
## Deploy
3832

39-
### Vercel(Recommended)
33+
### Vercel (Recommended)
4034

4135
Click https://vercel.com/new to deploy your fork repo.
4236

@@ -68,7 +62,8 @@ docker run -d \
6862
containrrr/watchtower -c notea
6963
```
7064

71-
If you are looking for MinIO + Notea docker configuration [check this](https://www.reddit.com/r/selfhosted/comments/n0jacf/notea_selfhosted_notetaking_app_stored_on_s3_aka/gw89iyo?utm_source=share&utm_medium=web2x&context=3)
65+
If you are looking for MinIO + Notea docker
66+
configuration [check this](https://www.reddit.com/r/selfhosted/comments/n0jacf/notea_selfhosted_notetaking_app_stored_on_s3_aka/gw89iyo?utm_source=share&utm_medium=web2x&context=3)
7267

7368
## Storage
7469

@@ -187,16 +182,20 @@ yarn dev
187182

188183
### What is S3? And what is MinIO?
189184

190-
- Amazon Simple Storage Service (AKA Amazon S3). TLDR: Read and write stored files or pictures through RESTful API.
191-
- MinIO: a self-hosted S3. Install by docker: `docker run -p 9000:9000 minio/minio server /data`
185+
- Amazon Simple Storage Service (AKA Amazon S3). TLDR: Read and write stored files or pictures through RESTful API.
186+
- MinIO: a self-hosted S3. Install by docker: `docker run -p 9000:9000 minio/minio server /data`
192187

193188
### Why not use Database?
194189

195-
Personally speaking, the data stored in Notea is mainly files (such as text or pictures) but the database is not good at reading and writing these type of files; S3 can generate a signed URL to access the remote files, but the database cannot do it.
190+
Personally speaking, the data stored in Notea is mainly files (such as text or pictures) but the database is not good at
191+
reading and writing these type of files; S3 can generate a signed URL to access the remote files, but the database
192+
cannot do it.
196193

197194
### Why not use filesystem storage?
198195

199-
There are many excellent offline note-taking apps supporting filesystem storage available. However, I couldn't find a APP that supports both self-hosted and easy to manage the synchronized data. The purpose of this project is to mitigate the above pain-point.
196+
There are many excellent offline note-taking apps supporting filesystem storage available. However, I couldn't find an
197+
APP that supports both self-hosted and easy to manage the synchronized data. The purpose of this project is to mitigate
198+
the above pain-point.
200199

201200
## Backers
202201

@@ -206,7 +205,8 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
206205

207206
## Sponsors
208207

209-
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/notea#sponsors)]
208+
Support this project by becoming a sponsor. Your logo will show up here with a link to your
209+
website. [[Become a sponsor](https://opencollective.com/notea#sponsors)]
210210

211211
<a href="https://opencollective.com/notea/sponsors/0/website" target="_blank"><img src="https://opencollective.com/notea/sponsors/0/avatar.svg"></a>
212212
<a href="https://opencollective.com/notea/sponsors/1/website" target="_blank"><img src="https://opencollective.com/notea/sponsors/1/avatar.svg"></a>

0 commit comments

Comments
 (0)