1. Project introduction
1. Project Brief Description
mininote, is a Vue3Simple, self-hosted, encrypted Markdown notes application built with Express
2.Project functions
mininote provides a simple personal note-taking interface that supports Markdown syntax, and records everything you need anytime and anywhere; mininote has efficient classification and labeling functions, which can help you record the progress of work projects, daily work task lists and personal memos in different scenarios; it also supports team collaboration, which can create a private meeting minutes of a work team or build project workflow, and your notes can be stored encrypted!
The encryption feature of mininote is that the title and content of each note is encrypted on the client (i.e. in your browser) using the symmetric AES-GCM provided by the Web Crypto API. However, the password of the notebook is used to derive the encryption key. That is, the strength of the encryption depends on your password. Also, although notes are sent to the server encrypted, this cannot be considered true end-to-end encryption, because technically the server has the opportunity to record your password the moment you create a new notebook in the first place.
3. Project open source address
https:///muety/mininote
----------
2. Project construction environment
1. Project Test Environment
A. The project is built on Tencent Cloud Centos7.6, the external network address is43.138.153.157
Linux VM-8-12-centos 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Version is26.01, docker-compose version is v2.26.1
Note: The deployment environment for this practice is a test environment for Tencent Cloud. If it is a production environment, please deploy it with caution; the corresponding ports that have opened the container must be opened under Linux and firewall.
2. The implementation process of this project
Use docker to download the image, create the path that the project needs to be mounted, start the container through docker-cli or docker compose, check the container startup status after starting the container, and check whether the container's running log is normal. All of the above are executed normally and experienced the project function.
3.Note: Docker download mirrors may encounter relatively slow situations, please refer to the following solutions:
Configure source change, enter/etc/Docker path, if not, create this directory
cd /etc/docker/
mkdir -p /etc/docker
B. Edit the configuration file
vim ## You can clear the contents inside: %d and then copy the source below and save it in wq
{
"registry-mirrors":[
""
]
}
-mirrors: Specifies the URL of a mirror repository https://286u3d9. This configuration item is used to set the Docker image's image repository address so that it can be accelerated through the Docker image when pulling and pushing. What is provided here is the mirror source of the Guangdong Guangzhou server. It is recommended that individuals go to Alibaba Cloud to build a personal account and obtain the mirror source according to the actual area.
D. Reload the source and restart the docker service
sudo systemctl daemon-reload
sudo systemctl restart docker
----------
3. Inspection before project construction
1Check whether docker is running normally
systemctl status docker
or
service docker status
Note: My personal test environment is managed using systemctl. If you use service management, please use the second command to view it.
[root@VM-8-12-centos ~]# systemctl status docker
● - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/; enabled; vendor preset: disabled)
Active: active (running) since Mon 2024-04-22 23:13:57 CST; 4 days ago
Docs: https://
Main PID: 17092 (dockerd)
Tasks: 158
Memory: 142.3M
CGroup: //
If the docker's Active is active (running), it means that the docker is running normally.
2. Generally, I will use docker-compose to manage, so I need to create a yaml file, vim, and the format is as follows:
version: '3.9'
services:
nginx:
image: nginx
logging:
options:
max-size: 1g
restart: always
volumes:
- '/var/run/:/tmp/:ro'
ports:
- '80:80'
----------
4. Project implementation process
1.From the open source project, find the corresponding image and pull it. If you encounter a very slow situation, first check whether the network problem is wrong and whether the source has been changed.
docker pull /muety/mininote
[root@VM-8-12-centos ~]# docker pull /muety/mininote
Using default tag: latest
latest: Pulling from muety/mininote
c158987b0551: Pull complete
ffe47f20beda: Pull complete
44600e8ec9ae: Pull complete
69ec3c51c045: Pull complete
3a9be6a4947d: Pull complete
2944509d34a5: Pull complete
367681d9c632: Pull complete
9a3f778f1f65: Pull complete
Digest: sha256:1c3546a4ce6aea5b448c18d59a0ac9a23f7c76b8dee704fba95b3ac5f4e0726a
Status: Downloaded newer image for /muety/mininote:latest
2.If the download has been completed and a new line is displayed, you can enter the command to see if the previous command was successfully executed.
echo$?
If you return0, then it will be successful; return to other things and download them again according to the actual situation or find the reason.
3After downloading .docker, you can check whether the corresponding image is successfully downloaded.
docker images |grep mininote
[root@VM-8-12-centos ~]# docker images |grep mininote
/muety/mininote latest 108c10ab6b97 15 months ago 986MB
4.Create a Mininote directory
mkdir -p /opt/mininote
5.Generate ssl certificate
cd /opt/mininote
openssl genrsa -out mininote.key 2048
openssl req -new -key mininote.key -out
openssl x509 -req -in -signkey mininote.key -out mininote.crt
6.After downloading, edit the file
version: '3.9'
services:
mininote:
image: '/muety/mininote:latest'
environment:
- HTTPS_KEY=/etc/mininote.key
- HTTPS_CERT=/etc/mininote.crt
volumes:
- '/opt/mininote/:/etc/:ro'
- '/opt/mininote/:/etc/:ro'
- '/opt/mininote:/app/data'
container_name: mininote
ports:
- '3120:3000'
After editing, enter wq to save
7.For convenient startup, you can also use docker-cli to start
docker run -d -p 3120:3000 --name mininote -v /opt/mininote:/app/data -v /opt/mininote/mininote.crt:/etc/mininote.crt:ro -v /opt/mininote/mininote.key:/etc/mininote.key:ro -e HTTPS_CERT=/etc/mininote.crt -e HTTPS_KEY=/etc/mininote.key /muety/mininote:latest
8.Start docker-compose
docker compose up -d
9.After starting the container, check whether the container's status is normal
docker ps |grep mininote
[root@VM-8-12-centos mininote]# docker ps |grep mininote
314f808487e3 /muety/mininote:latest "/bin/sh -c 'yarn st…" About a minute ago Up About a minute 0.0.0.0:3120->3000/tcp, :::3120->3000/tcp mininote
10.After starting the container, check whether the container's log is normal
docker logs -f mininote
[root@VM-8-12-centos mininote]# docker logs -f mininote
yarn run v1.22.19
$ node index.js
Listening on localhost:3000.
----------
5. Project experience
Note: Remember to release the firewall for cloud servers3120!
Access address https://43.138.153.157:3120/, welcome to click and play!
ps: My test server is the beggar version, so every time a large project is released and started, the previous project may be killed, otherwise it will get stuck. Please understand...
For more fun, interesting and useful content, please follow the WeChat official account: Zero Kr's Cloud Native