mirror of
https://codeberg.org/diginaut/digimarks.git
synced 2026-03-22 00:00:48 +01:00
Reworked into Markdown
This commit is contained in:
149
README.md
149
README.md
@@ -1,111 +1,110 @@
|
||||
🔖 digimarks
|
||||
===========
|
||||
# 🔖 digimarks
|
||||
|
||||
|PyPI version| |PyPI license| |Code health| |Codacy|
|
||||
[](https://pypi.python.org/pypi/digimarks/)
|
||||
[](https://pypi.python.org/pypi/digimarks/)
|
||||
[](https://app.codacy.com/app/aquatix/digimarks?utm_source=github.com&utm_medium=referral&utm_content=aquatix/digimarks&utm_campaign=badger)
|
||||
|
||||
|
||||
📚 Overview
|
||||
----------
|
||||
## 📚 Overview
|
||||
|
||||
Simple bookmarking service, using a SQLite database to store bookmarks, supporting tags and automatic title fetching. Notes can be added, the items are cached locally in the browser, and the API is documented so everything can be accessed through that too.
|
||||
|
||||
[digimarks source](https://codeberg.org/diginaut/digimarks)
|
||||
|
||||
📥 Installation
|
||||
--------------
|
||||
|
||||
From PyPI
|
||||
~~~~~~~~~
|
||||
## 📥 Installation
|
||||
|
||||
There are a few ways to install digimarks to your computer or server.
|
||||
|
||||
### From PyPI
|
||||
|
||||
Assuming you already are inside a virtualenv:
|
||||
|
||||
.. code-block:: bash
|
||||
```bash
|
||||
# Using the wonderfully fast uv
|
||||
uv pip install digimarks
|
||||
|
||||
# Using the wonderfully fast uv
|
||||
uv pip install digimarks
|
||||
|
||||
# Alternatively, use Python pip
|
||||
pip install digimarks
|
||||
# Alternatively, use Python pip
|
||||
pip install digimarks
|
||||
```
|
||||
|
||||
|
||||
From Git
|
||||
~~~~~~~~
|
||||
### From Git
|
||||
|
||||
Create a new virtualenv (if you are not already in one) and install the
|
||||
necessary packages:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git clone https://codeberg.org/diginaut/digimarks.git
|
||||
cd digimarks
|
||||
# direnv will now create or activate a virtualenv
|
||||
# See https://codeberg.org/diginaut/dotfiles/src/branch/master/.config/direnv/direnvrc for direnv uv config
|
||||
# If you just want to run it, no need for development dependencies
|
||||
uv sync --active --no-dev
|
||||
# Otherwise, install everything in the active virtualenv
|
||||
uv sync --active
|
||||
```bash
|
||||
git clone https://codeberg.org/diginaut/digimarks.git
|
||||
cd digimarks
|
||||
# direnv will now create or activate a virtualenv
|
||||
# See https://codeberg.org/diginaut/dotfiles/src/branch/master/.config/direnv/direnvrc for direnv uv config
|
||||
# If you just want to run it, no need for development dependencies
|
||||
uv sync --active --no-dev
|
||||
# Otherwise, install everything in the active virtualenv
|
||||
uv sync --active
|
||||
```
|
||||
|
||||
|
||||
⚙️ Migrating from version 1
|
||||
--------------------------
|
||||
## ⚙️ Migrating from version 1
|
||||
|
||||
To be able to use the new database schema's, you will need to migrate your existing ``bookmarks.db`` to one under the control of the ``alembic`` migrations tool.
|
||||
To be able to use the new database schema's, you will need to migrate your existing `bookmarks.db` to one under the control of the `alembic` migrations tool.
|
||||
|
||||
To do so, start with making a backup of this ``bookmarks.db`` file to a safe place.
|
||||
To do so, start with making a backup of this `bookmarks.db` file to a safe place.
|
||||
|
||||
Then, stamp the initial migration into the database, and migrate to the latest version:
|
||||
|
||||
.. code-block:: bash
|
||||
```bash
|
||||
# Initiate migrations with the first one (only needs to be done once!)
|
||||
alembic stamp 115bcd2e1a38
|
||||
|
||||
# Initiate migrations with the first one (only needs to be done once!)
|
||||
alembic stamp 115bcd2e1a38
|
||||
|
||||
# Apply all migrations to get up-to-date
|
||||
alembic upgrade head
|
||||
# Apply all migrations to get up-to-date
|
||||
alembic upgrade head
|
||||
```
|
||||
|
||||
|
||||
🛠️ Usage / example configuration
|
||||
-------------------------------
|
||||
## 🛠️ Usage / example configuration
|
||||
|
||||
⚠️ OUT OF DATE! ⚠️
|
||||
|
||||
Copy ``settings.py`` from example_config to the parent directory and
|
||||
Copy `settings.py` from example_config to the parent directory and
|
||||
configure to your needs (*at the least* change the value of `SYSTEMKEY`).
|
||||
|
||||
Do not forget to fill in the ``MASHAPE_API_KEY`` value, which you `can request on the RapidAPI website <https://rapidapi.com/realfavicongenerator/api/realfavicongenerator>`_.
|
||||
Do not forget to fill in the `MASHAPE_API_KEY` value, which you `can request on the RapidAPI website <https://rapidapi.com/realfavicongenerator/api/realfavicongenerator>`_.
|
||||
|
||||
Run digimarks as a service under nginx or apache and call the appropriate url's when wanted.
|
||||
|
||||
Url's are of the form ``https://marks.example.com/<userkey>/<action>``
|
||||
Url's are of the form `https://marks.example.com/<userkey>/<action>`
|
||||
|
||||
digimarks can also be run from the command line: ``uvicorn digimarks:app --reload``
|
||||
digimarks can also be run from the command line: `uvicorn digimarks:app --reload`
|
||||
|
||||
Be sure to export/set the ``SECRETKEY`` environment variable before running, it's needed for some management URI's.
|
||||
Be sure to export/set the `SECRETKEY` environment variable before running, it's needed for some management URI's.
|
||||
|
||||
Run ``gunicorn -k uvicorn.workers.UvicornWorker`` for production. For an example of how to set up a server `see this article <https://www.slingacademy.com/article/deploying-fastapi-on-ubuntu-with-nginx-and-lets-encrypt/>`_ with configuration for nginx, uvicorn, systemd, security and such.
|
||||
Run `gunicorn -k uvicorn.workers.UvicornWorker` for production. For an example of how to set up a server `see this article <https://www.slingacademy.com/article/deploying-fastapi-on-ubuntu-with-nginx-and-lets-encrypt/>`_ with configuration for nginx, uvicorn, systemd, security and such.
|
||||
|
||||
The RQ background worker can be run from the command line: ``rq worker --with-scheduler``
|
||||
The RQ background worker can be run from the command line: `rq worker --with-scheduler`
|
||||
|
||||
Url's are of the form https://hook.example.com/app/<appkey>/<triggerkey>
|
||||
Url's are of the form `https://hook.example.com/app/<appkey>/<triggerkey>`
|
||||
|
||||
API documentation is auto-generated, and can be browsed at https://hook.example.com/docs
|
||||
|
||||
|
||||
Bookmarklet
|
||||
~~~~~~~~~~~
|
||||
### Bookmarklet
|
||||
|
||||
To easily save a link from your browser, open its bookmark manager and create a new bookmark with as url:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
javascript:location.href='http://marks.example.com/1234567890abcdef/add?url='+encodeURIComponent(location.href);
|
||||
```javascript
|
||||
javascript:location.href='http://marks.example.com/1234567890abcdef/add?url='+encodeURIComponent(location.href);
|
||||
```
|
||||
|
||||
|
||||
Creating a new user
|
||||
-------------------
|
||||
## Creating a new user
|
||||
|
||||
After having set up the ``settings.py`` as under Usage, you can add a new user, by going to this path on your digimarks server:
|
||||
After having set up the `settings.py` as under Usage, you can add a new user, by going to this path on your digimarks server:
|
||||
|
||||
```
|
||||
/<secretkey>/adduser
|
||||
```
|
||||
|
||||
where `secretkey` is the value set in settings.SYSTEMKEY
|
||||
|
||||
@@ -114,42 +113,18 @@ digimarks will then redirect to the bookmarks overview page of the new user. Ple
|
||||
If you for whatever reason would lose this user key, just either look on the console (or webserver logs) where the list of available user keys is printed on digimarks startup, or open bookmarks.db with a SQLite editor.
|
||||
|
||||
|
||||
🔧 Server configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
## 🔧 Server configuration
|
||||
|
||||
* `systemd for digimarks API`_ which uses the `gunicorn config`_
|
||||
* `nginx for digimarks API`_
|
||||
* `more config`_
|
||||
- [systemd for digimarks API](https://codeberg.org/diginaut/digimarks/blob/master/example_config/systemd/digimarks.service) which uses the [gunicorn config](https://codeberg.org/diginaut/digimarks/src/branch/master/example_config/uwsgi.ini)
|
||||
- [nginx for digimarks API]()
|
||||
- [more config](https://codeberg.org/diginaut/digimarks/src/branch/master/example_config)
|
||||
|
||||
|
||||
✨ What's new?
|
||||
-------------
|
||||
## ✨ What's new?
|
||||
|
||||
See the `Changelog`_.
|
||||
See the [Changelog](https://codeberg.org/diginaut/digimarks/blob/master/CHANGELOG.md)
|
||||
|
||||
|
||||
🙏 Attributions
|
||||
--------------
|
||||
## 🙏 Attributions
|
||||
|
||||
'M' favicon by `Freepik`_.
|
||||
|
||||
|
||||
.. _digimarks: https://codeberg.org/diginaut/digimarks
|
||||
.. |PyPI version| image:: https://img.shields.io/pypi/v/digimarks.svg
|
||||
:target: https://pypi.python.org/pypi/digimarks/
|
||||
.. |PyPI license| image:: https://img.shields.io/github/license/aquatix/digimarks.svg
|
||||
:target: https://pypi.python.org/pypi/digimarks/
|
||||
.. |Code health| image:: https://landscape.io/github/aquatix/digimarks/master/landscape.svg?style=flat
|
||||
:target: https://landscape.io/github/aquatix/digimarks/master
|
||||
:alt: Code Health
|
||||
.. |Codacy| image:: https://api.codacy.com/project/badge/Grade/9a34319d917b43219a29e59e9ac75e3b
|
||||
:alt: Codacy Badge
|
||||
:target: https://app.codacy.com/app/aquatix/digimarks?utm_source=github.com&utm_medium=referral&utm_content=aquatix/digimarks&utm_campaign=badger
|
||||
.. _hook settings: https://codeberg.org/diginaut/digimarks/blob/master/example_config/examples.yaml
|
||||
.. _vhost for Apache2.4: https://codeberg.org/diginaut/digimarks/blob/master/example_config/apache_vhost.conf
|
||||
.. _uwsgi.ini: https://codeberg.org/diginaut/digimarks/blob/master/example_config/uwsgi.ini
|
||||
.. _Changelog: https://codeberg.org/diginaut/digimarks/blob/master/CHANGELOG.md
|
||||
.. _Freepik: http://www.flaticon.com/free-icon/letter-m_2041
|
||||
.. _systemd for digimarks API: https://codeberg.org/diginaut/digimarks/blob/master/example_config/systemd/digimarks.service
|
||||
.. _gunicorn config: https://codeberg.org/diginaut/digimarks/src/branch/master/example_config/uwsgi.ini
|
||||
.. _more config: https://codeberg.org/diginaut/digimarks/src/branch/master/example_config
|
||||
'M' favicon by [Freepik](http://www.flaticon.com/free-icon/letter-m_2041)
|
||||
|
||||
Reference in New Issue
Block a user