buku/bukuserver/README.md

179 lines
5.0 KiB
Markdown
Raw Normal View History

2018-05-25 17:59:40 -05:00
## Bukuserver
### Table of Contents
- [Installation](#installation)
- [Dependencies](#dependencies)
- [From PyPi](#from-pypi)
- [From source](#from-source)
- [Using Docker](#using-docker)
- [Using Docker Compose](#using-docker-compose)
2018-05-25 17:59:40 -05:00
- [Webserver options](#webserver-options)
- [Configuration](#configuration)
2018-05-25 18:26:31 -05:00
- [Screenshots](#screenshots)
2018-05-25 17:59:40 -05:00
### Installation
You need to have some packages before you install `bukuserver` on your server.
So be sure to have `python3`, `python3-pip` , `python3-dev`, `libffi-dev` packages from your distribution.
#### Dependencies
2018-05-25 17:59:40 -05:00
```
$ python3 -m pip install --user --upgrade pip
$ python3 -m pip install --user virtualenv
$ python3 -m virtualenv env
$ source env/bin/activate
```
#### From PyPi
2018-05-25 17:59:40 -05:00
$ pip3 install buku[server]
#### From source
```
$ git clone https://github.com/jarun/buku
$ cd buku
$ pip3 install .[server]
```
#### Using Docker
To build the image execute the command from the root directory of the project:
```sh
docker build -t bukuserver .
```
To run the generated image.
```sh
docker run -it --rm -v ~/.local/share/buku:/root/.local/share/buku -p 5001:5001 bukuserver
```
All the data generated will be stored in the `~/.local/share/buku` directory.
Feel free to change it to the full path of the location you want to store the
database.
Visit `127.0.0.1:5001` in your browser to access your bookmarks.
#### Using Docker Compose
There is a `docker-compose.yml` file present in the `docker-compose` directory
in the root of this project. You may modify the configurations in this file to
your liking, and then simply execute the below command.
```sh
docker-compose up -d
```
You will have you bukuserver running on port port 80 of the host.
To stop simply run
```sh
docker-compose down
```
In case you want to add basic auth to your hosted instance you may do so by
creating a `.htpasswd` file in the `data/basic_auth` directory. Add a user to
the file using
```sh
htpasswd -c data/basic_auth/.htpasswd your_username
```
And then comment out the basic auth lines from the `data/nginx/nginx.conf` file.
For more information please refer the [nginx docs](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/).
2018-05-25 17:59:40 -05:00
### Webserver options
To run the server on host 127.0.0.1, port 5001, run following command:
$ bukuserver run --host 127.0.0.1 --port 5001
Visit `127.0.0.1:5001` in your browser to access your bookmarks.
See more option on `bukuserver run --help` and `bukuserver --help`
### Configuration
Following are available os env config available for bukuserver.
2018-05-29 07:32:12 -05:00
| Name (without prefix) | Description | Value |
| --- | --- | --- |
| PER_PAGE | bookmarks per page | positive integer [default: 10] |
| SECRET_KEY | server secret key | string [default: os.urandom(24)] |
| URL_RENDER_MODE | url render mode | `full` or `netloc` [default: `full`] |
| DB_FILE | full path to db file | path string [default: standard path for buku] |
2019-05-27 08:24:30 -05:00
| DISABLE_FAVICON | disable favicon | boolean [default: `false`] |
2019-06-06 18:52:55 -05:00
| OPEN_IN_NEW_TAB | url link open in new tab | boolean [default: `false`] |
| REVERSE_PROXY_PATH | reverse proxy path | string |
2018-05-25 17:59:40 -05:00
Note: `BUKUSERVER_` is the common prefix.
Note: if input is invalid, the default value will be used if defined
2018-05-25 17:59:40 -05:00
e.g. to set bukuserver to show 100 item per page run the following command
```
# on linux
$ export BUKUSERVER_PER_PAGE=100
# on windows
$ SET BUKUSERVER_PER_PAGE=100
2018-05-29 07:32:12 -05:00
# in dockerfile
ENV BUKUSERVER_PER_PAGE=100
2018-05-25 17:59:40 -05:00
```
2018-05-25 18:26:31 -05:00
Note: the value for BUKUSERVER_REVERSE_PROXY_PATH
is recommended to include preceding slash and not have trailing slash
(i.e. use `/foo` not `/foo/`)
2018-05-25 18:26:31 -05:00
### Screenshots
<p><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/LozEqsT.png"><img src="https://i.imgur.com/LozEqsT.png" alt="home page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
<p align="center"><i>home page</i></a></p>
<p><br><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/DJUzs1d.png"><img src="https://i.imgur.com/DJUzs1d.png" alt="index page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
<p align="center"><i>bookmark stats</i></a></p>
<p><br><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/1eMruZD.png"><img src="https://i.imgur.com/1eMruZD.png" alt="index page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
2018-07-18 19:27:10 -05:00
<p align="center"><i>bookmark page</i></a></p>
2018-05-25 18:26:31 -05:00
<p><br><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/W4VUKQV.png"><img src="https://i.imgur.com/W4VUKQV.png" alt="index page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
2018-07-18 19:27:10 -05:00
<p align="center"><i>create bookmark</i></a></p>
2018-05-25 18:26:31 -05:00
<p><br><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/213y0Ft.png"><img src="https://i.imgur.com/213y0Ft.png" alt="index page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
2018-07-18 19:27:10 -05:00
<p align="center"><i>edit bookmark</i></a></p>
2018-05-25 18:26:31 -05:00
<p><br><br></p>
<p align="center">
2018-07-18 19:27:10 -05:00
<a href="https://i.imgur.com/MQM07VZ.png"><img src="https://i.imgur.com/MQM07VZ.png" alt="index page" width="650"/></a>
</p>
2018-07-18 23:16:04 -05:00
<p align="center"><i>view bookmark details</i></a></p>
2018-07-18 19:27:10 -05:00
<p><br><br></p>
<p align="center">
<a href="https://i.imgur.com/0bYgpER.png"><img src="https://i.imgur.com/0bYgpER.png" alt="index page" width="650"/></a>
2018-05-25 18:26:31 -05:00
</p>
<p align="center"><i>tag page</i></a></p>