Skip to content

Latest commit

 

History

History
146 lines (100 loc) · 4.05 KB

README-EN.md

File metadata and controls

146 lines (100 loc) · 4.05 KB

Docker run leanote

Screen shot

Bad english, that's all.

Image based mongo:3.2, data has been initialized, no database version need edit configuration file, then restart container.

Support tag list

full: full featured, for easy use

nodb: include some tools

lite: include leanote only, not support backup db and export pdf in web

Configure database(nodb version used)

Initial MongoDB see here

After imported data, these configuration should according to real envirmont update.

# mongdb
db.host=192.168.1.20
db.port=27017
db.dbname=leanote # required
db.username= # if not exists, please leave it blank
db.password= # if not exists, please leave it blank
# or you can set the mongodb url for more complex needs the format is:
# mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb
# db.url=mongodb://root:root123@localhost:27017/leanote
# db.urlEnv=${MONGODB_URL} # set url from env. eg. mongodb://root:root123@localhost:27017/leanote

Volumes

For easier to back up or migrate, suggest shard these folder.

/data/db                # Inner MongoDB data catalog, nodb version not contains this folder.
/data/leanote/conf      # Configuration file in this folder.
/data/leanote/files     # The file or images upload in this folder.
/data/leanote/public/upload     # Head image path

Run

docker run -d --name leanote \
    -v `pwd`/db:/data/db \
    -v `pwd`/conf/:/data/leanote/conf \
    -v `pwd`/files:/data/leanote/files \
    -p 9000:9000 \
    axboy/leanote

Backup data

  • Option one

Back up data by backing up files, not support major version updates

  • Option two

Using admin system backup, not support lite version

  • Option three

backup db by self

Edit timezone

Default timezone is Beijing/China(GMT+8), if want to edit, see here.

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
  • Cannot visit via ip

please find and update app.conf

http.addr=0.0.0.0 # listen on all ip addresses

Then restart Leanote

Other

  • The initial accounts:
user1 username: admin, password: abc123 (administrator who can manage Leanote)
user2 username: [email protected], password: [email protected] (just for demonstration)
  • disable demo account

demo account is a normal account acutally, can operate all resource in this account, It's recommended to disable it, you can deny the URL /demo.

server { 
    # ignore some config

    location / {
        proxy_pass              http://172.17.0.1:9000;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
    location /demo {
        deny all;
    }
}

  • config site.url

Config site.url in conf/app.conf file, it's the url in you browser, if not, you will not be able to logout in homepage, and some resource will not access in blog page.

http.ssl=true
http.sslcert=/data/leanote/conf/xxxxx.pem
http.sslkey=/data/leanote/conf/xxxxx.key