Skip to content

Commit

Permalink
Doc update (#67)
Browse files Browse the repository at this point in the history
* Updated README

* Added EXPOSE to Dockerfile for Docker Desktop

* Refactored docker compose file

* Updated CONTRIBUTING

* Docs update

* Added docs for sending files

* Added styling of scroll bar

* Fixed various colors

* Fixed Dockerfile exposed port

* Updated api docs for merging

* Attempt at fixing merge problems
  • Loading branch information
Casvt authored Mar 10, 2024
1 parent 3b75e7a commit 6fa9c10
Show file tree
Hide file tree
Showing 26 changed files with 773 additions and 243 deletions.
22 changes: 10 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to MIND
## General steps
Contributing to MIND consists of 5 steps:
Contributing to MIND consists of 5 steps, listed hereunder.

1. Make a [contributing request](https://github.com/Casvt/MIND/issues/new?template=contribute-request.md), where you describe what you plan on doing. This request needs to get approved before you can start, or your pull request won't be accepted. This is to avoid multiple people from doing the same thing and to avoid you wasting your time if we do not wish the changes. This is also where discussions can be held about how something will be implemented.
2. When the request is accepted, start your local development (more info about this below).
Expand All @@ -11,25 +11,23 @@ Contributing to MIND consists of 5 steps:
## Local development steps
Once your request is accepted, you can start your local development.

1. Fork the repository and clone the fork onto your computer and open it using your preferred IDE (Visual Studio Code is used by us).
2. Make the changes needed and write accompanying tests.
1. Clone the repository onto your computer and open it using your preferred IDE (Visual Studio Code is used by us).
2. Make the changes needed and write accompanying tests if needed.
3. Check if the code written follows the styling guide below.
4. If you want to run the tests manually before committing, use the command below in the root folder of the project:
4. Run the finished version, using python 3.8, to check if you've made any errors.
5. Run the tests (unittest is used). This can be done with a button click within VS Code, or with the following command where you need to be inside the root folder of the project:
```bash
python3 -m unittest discover -v -s './tests' -p '*_test.py'
python3 -m unittest discover -s ./tests -p '*.py'
```
5. Update the docs if needed.
6. Commit and push to your fork. When you push, GitHub Actions will do a lot of work for you: the tests are run again on python versions 3.8 - 3.11, the API documentation is updated if any changes have been made to the API and the docs are updated if any changes have been made to the docs. All GitHub Actions need to succeed before you're allowed to make a PR (you'll see a green checkmark next to the commit in GitHub).
6. Test your version thoroughly to catch as many bugs as possible (if any).

## Styling guide
The code of MIND is written in such way that it follows the following rules. Your code should too.

1. Compatible with python 3.8 .
1. Compatible with python 3.8 to 3.11 .
2. Tabs (4 space size) are used for indentation.
3. Use type hints as much as possible, though don't if it requires importing extra functions or classes (except for the `typing` library).
3. Use type hints as much as possible. If you encounter an import loop because something needs to be imported for type hinting, utilise [`typing.TYPE_CHECKING`](https://docs.python.org/3/library/typing.html#typing.TYPE_CHECKING).
4. Each function in the backend needs a doc string describing the function, what the inputs are, what errors could be raised from within the function and what the output is.
5. The imports need to be sorted (the extension `isort` is used in VS Code).
6. The code needs to be compatible with Linux, MacOS, Windows and Docker.
6. The code needs to be compatible with Linux, MacOS, Windows and the Docker container.
7. The code should, though not strictly enforced, reasonably comply with the rule of 80 characters per line.

If you just code in the same style as the current code, you'll follow most of these rules automatically.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ RUN pip3 install -r requirements.txt

COPY . .

EXPOSE 8080

CMD [ "python3", "/app/MIND.py" ]
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
# MIND

[![Docker Pulls](https://img.shields.io/docker/pulls/mrcas/mind.svg)](https://hub.docker.com/r/mrcas/mind)
[![GitHub Downloads](https://img.shields.io/github/downloads/Casvt/MIND/total.svg)](https://github.com/Casvt/MIND/releases)

__A simple self hosted reminder application that can send push notifications to your device. Set the reminder and forget about it!__

Mind is a simple self hosted application for creating reminders that get pushed to your device using the [Apprise](https://github.com/caronc/apprise) API. You can send messages to just about every platform, including scheduled emails!

## Workings
MIND can be used for sending notifications at the desired time. This can be a set time, like a yearly reminder for a birthday, or at a button click, to easily send a predefined notification when you want to.

MIND can be used for sending notifications at the desired time. This can be a set time, like a yearly reminder for a birthday, or at a button click, to easily send a predefined notification when you want to. The notification can be sent to 80+ platforms with the integration of [Apprise](https://github.com/caronc/apprise).

## Features

- Works cross-timezone

- Notifications are sent with second-precision
- Uses the [apprise library](https://github.com/caronc/apprise), giving you 80+ platforms to send notifications to

- Fine control over repetition: single time, time interval, certain weekdays or manual trigger.

- Uses the [Apprise library](https://github.com/caronc/apprise), giving you 80+ platforms to send notifications to and the option to send to multiple platforms for each reminder

- Easily manage the reminders with sorting options, search ability and color coding

- An admin panel for user management, settings and backups

- Docker image available

- Mobile friendly web-interface

- API available

### Planned Features
You can see the planned features in the [Project board](https://github.com/users/Casvt/projects/3).

## Getting started
Replace the timezone value (`TZ=`) to the [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of your timezone!
```bash
docker run -d \
--name mind \
-v mind-db:/app/db \
-e TZ=Europe/Amsterdam \
-p 8080:8080 \
mrcas/mind:latest
```

More information about installing can be found [in the wiki](https://casvt.github.io/MIND/).

## Contact
- For support, a [discord server](https://discord.gg/nMNdgG7vsE) is available
- Alternatively, [make an issue](https://github.com/Casvt/MIND/issues)
## Installation, support and documentation

- For instructions on how to install MIND, see the [installation documentation](https://casvt.github.io/MIND/installation/installation)

- For support, a [discord server](https://discord.gg/nMNdgG7vsE) is available or [make an issue](https://github.com/Casvt/MIND/issues)

- For all documentation, see the [documentation hub](https://casvt.github.io/MIND).

## Screenshots

<img src="https://github.com/Casvt/Kapowarr/assets/88994465/f55c895b-7975-4a3e-88a0-f8e2a148bf8a" style="width: max(45%, 400px); margin: .5rem;">
<img src="https://github.com/Casvt/Kapowarr/assets/88994465/63d72943-0c88-4315-9a8a-01a5dc5f6f15" style="width: max(45%, 400px); margin: .5rem;">
<img src="https://github.com/Casvt/Kapowarr/assets/88994465/1f9cc9a2-ced5-49a2-b779-93528bb50bd4" style="width: max(45%, 400px); margin: .5rem;">
11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
version: '3.3'
version: "3.3"
services:
mind:
container_name: mind
image: mrcas/mind:latest
volumes:
- 'mind-db:/app/db'
- "mind-db:/app/db"
environment:
- TZ=Europe/Amsterdam
ports:
- '8080:8080'
image: 'mrcas/mind:latest'
- 8080:8080

volumes:
mind-db:
3 changes: 1 addition & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,5 +878,4 @@ Replace `<int:u_id>` with the ID of the entry. For example: `/admin/users/2`.
| 201 | N/A | Success |
| 400 | InvalidDatabaseFile | The uploaded database file is invalid or not supported |
| 400 | InvalidKeyValue | The value of a key is invalid |
| 400 | KeyNotFound | A key was not found in the input that is required to be given |

| 400 | KeyNotFound | A key was not found in the input that is required to be given |
29 changes: 25 additions & 4 deletions docs/assets/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
--color-dark: #1b1b1b;
}

::-webkit-scrollbar {
width: 12px;
height: 12px;
background-color: var(--color-gray);
}

::-webkit-scrollbar-thumb {
-webkit-border-radius: 6px;
background-color: var(--color-dim-light);
}

::-webkit-scrollbar-thumb:hover {
background-color: var(--color-light);
}

.md-typeset code {
border-radius: 6px;
}
Expand Down Expand Up @@ -54,6 +69,9 @@
/* Hover color for mark and ToC */
--md-accent-fg-color: var(--color-gray);

/* BG color git link in mobile nav */
--md-primary-fg-color--dark: var(--color-gray);

/* Code color */
--md-code-fg-color: var(--color-light);
/* Code background color */
Expand Down Expand Up @@ -117,8 +135,8 @@
color: var(--color-gray);
}

[data-md-color-scheme="MIND"] .tabbed-block {
--md-default-fg-color--light: var(--color-dark);
[data-md-color-scheme="MIND"] [data-md-component="sidebar"][data-md-type="navigation"] nav > label {
background-color: var(--color-gray);
}

[data-md-color-scheme="MIND"] details {
Expand Down Expand Up @@ -158,6 +176,9 @@
/* Hover color for mark and ToC */
--md-accent-fg-color: var(--color-dim-light);

/* BG color git link in mobile nav */
--md-primary-fg-color--dark: var(--color-gray);

/* Code color */
--md-code-fg-color: var(--color-light);
/* Code background color */
Expand Down Expand Up @@ -217,8 +238,8 @@
color: var(--color-dim-light);
}

[data-md-color-scheme="MIND-dark"] .tabbed-block {
--md-default-fg-color--light: var(--color-dark);
[data-md-color-scheme="MIND-dark"] [data-md-component="sidebar"][data-md-type="navigation"] nav > label {
background-color: var(--color-dim-light);
}

[data-md-color-scheme="MIND-dark"] details {
Expand Down
23 changes: 0 additions & 23 deletions docs/backup_your_data.md

This file was deleted.

54 changes: 54 additions & 0 deletions docs/general_info/admin_panel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Introduction

The admin panel allows you to manage your MIND instance. It has multiple features regarding the management of your instance and it's users. You can change how users authenticate and create accounts, download the logs, change the hosting settings, add/edit/delete users, export and import the database and restart or shutdown the application.

!!! warning "Restrict Access"
The panel gives you a lot of power, so it's important that nobody can access it but you (by changing the default password).

### Accessing the panel

You can access the admin panel by logging into the admin account. The default username is `admin` and the default password is `admin`. How to change the password (which is strongly recommended) is described in the ['User Management' section](#user-management).

## Authentication

The authentication settings are described on the ['Admin Settings' page](../settings/admin_settings.md#authentication).

## Logging

The 'Logging Level' setting is for enabling debug logging. Only enable this when you encounter problems and need to share logs. Once enabled, all debug logs will go to a file. This file, containing all the debug logs, can be downloaded using the 'Download Debug Logs' button. Once the logging level is set back to `Info`, the debug logging to the file will be stopped. Once the logging level is set to `Debug` again, the file will be emptied and all debug logs will be put in it again. With this setup, you can enable debug logging, reproduce the error (which will be logged to the file), disable debug logging and download the log file. The file will then contain all relevant logs.

## Hosting

The hosting settings are described on the ['Admin Settings' page](../settings/admin_settings.md#hosting).

## User Management

The admin panel allows you to manage the users on your instance. You can add new users, change the password of existing users and delete users. The ability to add users will always be there, regardless of the value of the ['Allow New Accounts' setting](../settings/admin_settings.md#allow-new-accounts). If that setting is disabled (disallowing users to create accounts themselves), then the admin panel is the only place where new accounts can be made.

If the username field turns red while adding a new user, then the username is either already taken or is invalid.

Click on the pen icon to change the password of the user. This is useful if the user has forgotten their password. You can also change the password of the admin user this way, which is strongly recommended.

## Database

The 'Download Database' button allows you to download the complete MIND database. This file contains everything: all user accounts, their settings, notification services and reminders, and admin settings (authentication, hosting, etc.). This file represents a complete back-up of your MIND instance.

The admin panel offers the option to upload a database file to apply. There are multiple scenarios where you'd want to upload a database (import a backup):

1. You can recover all data up to the point of database export in the case that something goes wrong.
2. You can revert back to a stable state when trying something.
3. You're moving to a new computer/instance and want to move all user data too.

Select the database file that you want to import for the 'Database File' input. Enabling the 'Keep Hosting Settings' option will copy the hosting settings from the current database over to the imported database. This will result in the instance being hosted with the same settings as it is now. If you leave this setting disabled, the hosting settings from the imported database will be used. That could result in the web-UI being hosted with different settings, potentially making it unreachable.

The uploaded file could be denied for multiple reasons:

1. It is not an (sqlite) database file. Only import database files that you downloaded with the 'Download Database' button.
2. The database file is too old. If the database is for such an old version of MIND, it could fail to migrate it.
3. The database file is too new. If the database is for a newer version of MIND than the version that you upload it to, it get's denied.

After importing the database, MIND will restart with the new database in use. **_It is required to log into the admin panel within one minute in order to keep the newly imported database file. If you do not, the import will be reverted, MIND will restart again but now with the old database again._** This is in order to protect you from breaking MIND if the database file is invalid or if the hosting settings make the UI unreachable (if you have the 'Keep Hosting Settings' option disabled).

## Power

You can use these buttons to restart or shutdown the application.
Loading

0 comments on commit 6fa9c10

Please sign in to comment.