An open API service indexing awesome lists of open source software.

https://github.com/cfms-dev/cfms_on_websocket

A server-side implementation of a complete system designed for managing confidential documents, called Confidential File Management System (CFMS), running on the WebSocket protocol.
https://github.com/cfms-dev/cfms_on_websocket

confidential file-management management-system server websocket

Last synced: about 1 month ago
JSON representation

A server-side implementation of a complete system designed for managing confidential documents, called Confidential File Management System (CFMS), running on the WebSocket protocol.

Awesome Lists containing this project

README

          

# CFMS on WebSocket

CFMS (Confidential File Management System), is a complete solution for
managing confidential documents. This is the repository used to
implement server functionality.

The Project is still in the early stages of development and cannot
guarantee the security and stability of running the Service.

Welcome to Github Issues for improvements and bug reports.

You can access the Chinese Simplified version of the development
documentation here: [CFMS Server Documentation][doc-url]
However, Since this document was written specifically for the previous
version of CFMS, much of it may be outdated. If possible, use code
comments as the primary reference.

[doc-url]: https://cfms-server-doc.readthedocs.io/zh_CN/latest

## Quick Setup

```bash
# Clone repo
git clone https://github.com/cfms-dev/cfms_on_websocket.git

# Enter working dir
cd cfms_on_websocket/src

# Setup submodules
git submodule init
git submodule update --depth=1

# Setup dependencies
uv sync --upgrade

# Activate virtual environment
source .venv/bin/activate
```

## Optional Dependencies

CFMS has some optional features that require additional dependencies to be
installed to enable them. For example, the following command will install
the necessary dependencies for cluster functionality and MySQL support:

```bash
uv sync --extra cluster --extra mysql
```

## Run
```bash
python main.py # DO NOT use `-O`!
```

## Database Migrations
The structure of the database varies between different server versions. In order
to allow server operators to upgrade to latest versions easily, here, we use
Alembic to handle database migrations.

**Note:**
1. Remember to backup your databases in advance to avoid data losses.

2. Configs and generated revisions in `/src/include/alembic/versions/` of
Alembic is designed for sqlite databases, and we don't guarantee that other types
of databases can be successfully upgraded via these revisions.

If you have not used Alembic yet, please run the command below **before** you
checkout new changes:

```bash
alembic stamp head
```

Then checkout the server version you wanted and run:

```bash
alembic upgrade head
```

## Development

Consider using pre-commit to provide an automated code standardization experience.

```bash
# Install development dependencies
uv sync --dev

# Install pre-commit hooks
uv run pre-commit install
```

## Testing

This repository includes an automated test suite built with pytest. Note that
you should finish the installation before running tests.

To run the tests:

```bash
# Install dependencies
uv sync --dev

# Run all tests
uv run pytest

# Run specific test files
uv run pytest tests/test_basic.py
```

For more information about the test suite, see [tests/README.md](tests/README.md).

## Security

We do our utmost to prevent and resolve security issues within our capabilities.
If you discover any existing vulnerabilities, you are welcome to submit a report
to us.

## Contributing

This is a project that is under active development and we are looking
for people interested in the project to participate in testing. We are
well aware that the system still has huge shortcomings as a functional
solution – and we want as many people as possible to join in improving
them.