mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-10 02:17:59 +00:00
Compare commits
5 commits
8fb966f02c
...
8bceca5c67
Author | SHA1 | Date | |
---|---|---|---|
8bceca5c67 | |||
65b6c0a5ad | |||
c67b26760b | |||
3707d3f5f6 | |||
87d58c95e6 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,7 +12,7 @@ __pycache__/
|
||||||
env/
|
env/
|
||||||
build/
|
build/
|
||||||
develop-eggs/
|
develop-eggs/
|
||||||
dist/
|
dist*/
|
||||||
downloads/
|
downloads/
|
||||||
eggs/
|
eggs/
|
||||||
.eggs/
|
.eggs/
|
||||||
|
|
22
Dockerfile
22
Dockerfile
|
@ -1,28 +1,20 @@
|
||||||
FROM python:3-alpine
|
FROM python:3.12-alpine
|
||||||
|
|
||||||
# install build deps for pycryptodome and other c-based python modules
|
|
||||||
RUN apk add alpine-sdk autoconf automake libtool gcc
|
|
||||||
|
|
||||||
# add env var to let the relay know it's in a container
|
# add env var to let the relay know it's in a container
|
||||||
ENV DOCKER_RUNNING=true
|
ENV DOCKER_RUNNING=true
|
||||||
|
|
||||||
# setup various container properties
|
# setup various container properties
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
CMD ["python", "-m", "relay"]
|
CMD ["python3", "-m", "relay"]
|
||||||
EXPOSE 8080/tcp
|
EXPOSE 8080/tcp
|
||||||
WORKDIR /opt/activityrelay
|
WORKDIR /opt/activityrelay
|
||||||
|
|
||||||
|
# only copy necessary files
|
||||||
|
COPY relay ./relay
|
||||||
|
COPY pyproject.toml ./
|
||||||
|
|
||||||
# install and update important python modules
|
# install and update important python modules
|
||||||
RUN pip3 install -U setuptools wheel pip
|
RUN pip3 install -U setuptools wheel pip
|
||||||
|
|
||||||
# only copy necessary files
|
|
||||||
COPY relay ./relay
|
|
||||||
COPY LICENSE .
|
|
||||||
COPY README.md .
|
|
||||||
COPY requirements.txt .
|
|
||||||
COPY setup.cfg .
|
|
||||||
COPY setup.py .
|
|
||||||
COPY .git ./.git
|
|
||||||
|
|
||||||
# install relay deps
|
# install relay deps
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install `python3 -c "import tomllib; print(' '.join(dep.replace(' ', '') for dep in tomllib.load(open('pyproject.toml', 'rb'))['project']['dependencies']))"`
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
flake8 == 7.0.0
|
|
||||||
mypy == 1.9.0
|
|
||||||
pyinstaller == 6.3.0
|
|
||||||
watchdog == 4.0.0
|
|
||||||
|
|
||||||
typing_extensions >= 4.10.0; python_version < '3.11.0'
|
|
|
@ -54,6 +54,7 @@ case $1 in
|
||||||
COLS="%-22s %s\n"
|
COLS="%-22s %s\n"
|
||||||
|
|
||||||
echo "Valid commands:"
|
echo "Valid commands:"
|
||||||
|
|
||||||
printf "$COLS" "- start" "Run the relay in the background"
|
printf "$COLS" "- start" "Run the relay in the background"
|
||||||
printf "$COLS" "- stop" "Stop the relay"
|
printf "$COLS" "- stop" "Stop the relay"
|
||||||
printf "$COLS" "- manage <cmd> [args]" "Run a relay management command"
|
printf "$COLS" "- manage <cmd> [args]" "Run a relay management command"
|
||||||
|
@ -62,5 +63,8 @@ case $1 in
|
||||||
printf "$COLS" "- rescue" "Drop into a bash shell on a temp container with the data volume mounted"
|
printf "$COLS" "- rescue" "Drop into a bash shell on a temp container with the data volume mounted"
|
||||||
printf "$COLS" "- install" "Build the image, create a new container and volume, and run relay setup"
|
printf "$COLS" "- install" "Build the image, create a new container and volume, and run relay setup"
|
||||||
printf "$COLS" "- uninstall" "Delete the relay image, container, and volume"
|
printf "$COLS" "- uninstall" "Delete the relay image, container, and volume"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Note: This script may not work. It is recommended to manually install and manage the container if you know what you're doing."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,7 +1,82 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools","wheel"]
|
requires = ["setuptools>=61.2"]
|
||||||
build-backend = 'setuptools.build_meta'
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "ActivityRelay"
|
||||||
|
description = "Generic LitePub relay (works with all LitePub consumers and Mastodon)"
|
||||||
|
license = {text = "AGPLv3"}
|
||||||
|
classifiers = [
|
||||||
|
"Environment :: Console",
|
||||||
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"activitypub-utils == 0.2.1",
|
||||||
|
"aiohttp >= 3.9.1",
|
||||||
|
"aiohttp-swagger[performance] == 1.0.16",
|
||||||
|
"argon2-cffi == 23.1.0",
|
||||||
|
"barkshark-sql == 0.1.2",
|
||||||
|
"click >= 8.1.2",
|
||||||
|
"hiredis == 2.3.2",
|
||||||
|
"jinja2-haml == 0.3.5",
|
||||||
|
"markdown == 3.5.2",
|
||||||
|
"platformdirs == 4.2.0",
|
||||||
|
"pyyaml >= 6.0",
|
||||||
|
"redis == 5.0.1",
|
||||||
|
"importlib_resources == 6.1.1; python_version < '3.9'"
|
||||||
|
]
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
|
[project.readme]
|
||||||
|
file = "README.md"
|
||||||
|
content-type = "text/markdown; charset=UTF-8"
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Documentation = "https://git.pleroma.social/pleroma/relay/-/blob/main/docs/index.md"
|
||||||
|
Source = "https://git.pleroma.social/pleroma/relay"
|
||||||
|
Tracker = "https://git.pleroma.social/pleroma/relay/-/issues"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
activityrelay = "relay.manage:main"
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"flake8 == 7.0.0",
|
||||||
|
"mypy == 1.9.0",
|
||||||
|
"pyinstaller == 6.3.0",
|
||||||
|
"watchdog == 4.0.0",
|
||||||
|
"typing_extensions >= 4.10.0; python_version < '3.11.0'"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
zip-safe = false
|
||||||
|
packages = [
|
||||||
|
"relay",
|
||||||
|
"relay.database",
|
||||||
|
"relay.views",
|
||||||
|
]
|
||||||
|
include-package-data = true
|
||||||
|
license-files = ["LICENSE"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
relay = [
|
||||||
|
"data/*",
|
||||||
|
"frontend/*",
|
||||||
|
"frontend/page/*",
|
||||||
|
"frontend/static/*"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic]
|
||||||
|
version = {attr = "relay.__version__"}
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic.optional-dependencies]
|
||||||
|
dev = {file = ["dev-requirements.txt"]}
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
show_traceback = true
|
show_traceback = true
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
activitypub-utils == 0.2.1
|
|
||||||
aiohttp >= 3.9.1
|
|
||||||
aiohttp-swagger[performance] == 1.0.16
|
|
||||||
argon2-cffi == 23.1.0
|
|
||||||
barkshark-sql @ https://git.barkshark.xyz/barkshark/bsql/archive/0.1.2.tar.gz
|
|
||||||
click >= 8.1.2
|
|
||||||
hiredis == 2.3.2
|
|
||||||
jinja2-haml == 0.3.5
|
|
||||||
markdown == 3.5.2
|
|
||||||
platformdirs == 4.2.0
|
|
||||||
pyyaml >= 6.0
|
|
||||||
redis == 5.0.1
|
|
||||||
|
|
||||||
importlib_resources == 6.1.1; python_version < '3.9'
|
|
51
setup.cfg
51
setup.cfg
|
@ -1,51 +0,0 @@
|
||||||
[metadata]
|
|
||||||
name = relay
|
|
||||||
version = attr: relay.__version__
|
|
||||||
description = Generic LitePub relay (works with all LitePub consumers and Mastodon)
|
|
||||||
long_description = file: README.md
|
|
||||||
long_description_content_type = text/markdown; charset=UTF-8
|
|
||||||
url = https://git.pleroma.social/pleroma/relay
|
|
||||||
license = AGPLv3
|
|
||||||
license_file = LICENSE
|
|
||||||
classifiers =
|
|
||||||
Environment :: Console
|
|
||||||
License :: OSI Approved :: GNU Affero General Public License v3
|
|
||||||
Programming Language :: Python :: 3.8
|
|
||||||
Programming Language :: Python :: 3.9
|
|
||||||
Programming Language :: Python :: 3.10
|
|
||||||
Programming Language :: Python :: 3.11
|
|
||||||
Programming Language :: Python :: 3.12
|
|
||||||
project_urls =
|
|
||||||
Source = https://git.pleroma.social/pleroma/relay
|
|
||||||
Tracker = https://git.pleroma.social/pleroma/relay/-/issues
|
|
||||||
|
|
||||||
[options]
|
|
||||||
zip_safe = False
|
|
||||||
packages =
|
|
||||||
relay
|
|
||||||
relay.database
|
|
||||||
relay.views
|
|
||||||
include_package_data = true
|
|
||||||
install_requires = file: requirements.txt
|
|
||||||
python_requires = >=3.8
|
|
||||||
|
|
||||||
[options.extras_require]
|
|
||||||
dev = file: dev-requirements.txt
|
|
||||||
|
|
||||||
[options.package_data]
|
|
||||||
relay =
|
|
||||||
data/*
|
|
||||||
frontend/*
|
|
||||||
frontend/page/*
|
|
||||||
|
|
||||||
[options.entry_points]
|
|
||||||
console_scripts =
|
|
||||||
activityrelay = relay.manage:main
|
|
||||||
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
extend-ignore = E128,E251,E261,E303,W191
|
|
||||||
max-line-length = 100
|
|
||||||
indent-size = 4
|
|
||||||
per-file-ignores =
|
|
||||||
__init__.py: F401
|
|
Loading…
Reference in a new issue