Rename project to pssecret #2

Merged
root merged 1 commit from rename-to-psssecret into main 2024-12-25 11:43:24 +00:00
14 changed files with 30 additions and 33 deletions
Showing only changes of commit d5fe39f2cc - Show all commits

3
.flake8 Normal file
View file

@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203, B008

4
.gitignore vendored
View file

@ -1,7 +1,7 @@
venv/
.idea/
dist/
rectes.egg-info/
pssecret.egg-info/
build/
conf/rectes.toml
conf/pssecret.toml
__pycache__/

View file

@ -1,29 +1,28 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
entry: pflake8
args: [--config, .flake8]
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- pyproject-flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
name: isort

View file

@ -1,8 +1,8 @@
# Rectes
# Pssecret
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Rectes (anagram from "secret") is self-hosted service to share secrets (like passwords) with somebody
Pssecret is self-hosted service to share secrets (like passwords) with somebody
over the network, but don't want them to appear in chats, unencrypted e-mails, etc.
This service tries to be as anonymous as possible. The only personal information that will be stored
@ -23,7 +23,7 @@ Service is built with Python, FastAPI and is using Redis for data storage.
#### TL/DR
```bash
$ git clone git@git.ivnglkv.ru:ivnglkv/rectes.git
$ git clone git@git.ivnglkv.me:root/pssecret.git
$ python3 -m venv venv
$ . ./venv/bin/activate
$ pip install .
@ -31,33 +31,33 @@ $ pip install .
---
Steps to install Rectes:
Steps to install Pssecret:
1. Clone repository
2. (optional) Create virtual environment
3. Install package
### Running Rectes server
### Running Pssecret server
After installation is done, you can start rectes with `rectes` command.
After installation is done, you can start pssecret with `pssecret` command.
The web server will be started with `uvicorn` ASGI web server.
```bash
$ rectes
$ pssecret
```
### Configuration
Configuration is done through config file. By default, path is `/etc/rectes/rectes.toml`.
You can override this by setting environment variable `RECTES_CONF_FILE` value to actual file
Configuration is done through config file. By default, path is `/etc/pssecret/pssecret.toml`.
You can override this by setting environment variable `PSSECRET_CONF_FILE` value to actual file
location, i.e.:
```bash
$ RECTES_CONF_FILE=/home/user/.conf/rectes.toml rectes
$ PSSECRET_CONF_FILE=/home/user/.conf/pssecret.toml pssecret
```
You can find all available configuration options in the example file, located
at [conf/rectes.toml.example](conf/rectes.toml.example) under Git root.
at [conf/pssecret.toml.example](conf/pssecret.toml.example) under Git root.
## Contributing
@ -66,7 +66,7 @@ Flake8 and isort. Prior to making any commits, install `pre-commit` tool and ins
```bash
# Alternatively, you could use 'pip install ".[development]"'
$ pip install pre-commit==2.19.0
$ pip install pre-commit
$ pre-commit install
```

View file

@ -4,7 +4,3 @@ build-backend = "setuptools.build_meta"
[tool.isort]
profile = "black"
[tool.flake8]
max-line-length = 88
extend-ignore = "E203, B008"

View file

@ -1,5 +1,5 @@
[metadata]
name = rectes
name = pssecret
version = 0.1
[options]
@ -18,7 +18,7 @@ development =
[options.entry_points]
console_scripts =
rectes = rectes:cli
pssecret = pssecret:cli
[options.packages.find]
where = src

View file

@ -1,9 +1,9 @@
from fastapi import FastAPI
from fastapi.exceptions import HTTPException
from rectes.models import Secret, SecretSaveResult
from rectes.redis_db import redis
from rectes.utils import get_new_key
from pssecret.models import Secret, SecretSaveResult
from pssecret.redis_db import redis
from pssecret.utils import get_new_key
app = FastAPI()

View file

@ -1,6 +1,6 @@
# noinspection PyUnresolvedReferences,PyProtectedMember
from redis import asyncio as aioredis
from rectes.settings import settings
from pssecret.settings import settings
redis = aioredis.from_url(settings.redis.url)

View file

@ -1,5 +1,4 @@
import os
import tomllib
@ -9,7 +8,7 @@ class Settings:
self._data = data
else:
with open(
os.getenv("RECTES_CONF_FILE", "/etc/rectes/rectes.toml"), "rb"
os.getenv("PSSECRET_CONF_FILE", "/etc/pssecret/pssecret.toml"), "rb"
) as f:
self._data = tomllib.load(f)

View file

@ -1,6 +1,6 @@
from uuid import uuid4
from rectes.redis_db import redis
from pssecret.redis_db import redis
async def get_new_key() -> str: