Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Leanote ====== ===== Installation ===== $ cd /opt $ sudo wget https://storage.googleapis.com/golang/go1.12.1.linux-amd64.tar.gz $ sudo tar -C /opt -xzf go*.tar.gz $ cat >> ~/.bashrc <<EOF $ export GOROOT=/opt/go $ export GOPATH=$HOME/gocode $ export PATH=$PATH:$GOROOT/bin:$GOPATH/bin $ EOF $ source ~/.bashrc ===== Setup ===== ## revel leanote $ go get github.com/revel/cmd/revel $ go get github.com/leanote/leanote/app ## mongodb $ sudo apt-get update $ sudo apt-get install mongodb $ mongorestore -h localhost -d leanote --dir /home/$USER/gocode/src/github.com/leanote/leanote/mongodb_backup/leanote_install_data/ $ mongo > use leanote; ## run # $ revel run ~/gocode/src/github.com/leanote/leanote ## add init info for LSB tags and overrides $ sudo nano /etc/init.d/leanote < /etc/init.d/leanote > #!/bin/bash ### BEGIN INIT INFO # Provides: leanote # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: leanote # Description: leanote pop & imap daemon ### END INIT INFO USER=`id -u user1` PIDFILE=/var/run/leanote.pid GOROOT="/opt/go" GOPATH="/home/user1/gocode" WORKDIR="/home/user1/gocode/src/github.com/leanote" CMD=`cd $WORKDIR; GOROOT=$GOROOT GOPATH=$GOPATH PATH=$PATH:$GOROOT/bin:$GOPATH/bin revel run $WORKDIR/lean$ case "$1" in start) /sbin/start-stop-daemon --start --user $USER --pidfile $PIDFILE --chuid $USER --startas $CMD ;; stop) /sbin/start-stop-daemon --stop --user $USER --pidfile $PIDFILE --chuid $USER ;; esac exit 0 $ sudo chmod +x /etc/init.d/leanote $ sudo nano /lib/systemd/system/leanote.service < /lib/systemd/system/leanote.service > [Unit] Description=Leanote [Service] Type=oneshot ExecStart=/etc/init.d/leanote start RemainAfterExit=no User=root Group=root [Install] WantedBy=multi-user.target selfhosted/leanote.txt Last modified: 2023/07/03 01:18by hli