mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-23 23:17:58 +00:00
Compare commits
No commits in common. "a271cf22b49452aedb3e97c5e3c2306d81391861" and "ae490a9bf3e4f971ec4d4bc1c6506791ff246b4c" have entirely different histories.
a271cf22b4
...
ae490a9bf3
|
@ -35,7 +35,7 @@ if typing.TYPE_CHECKING:
|
||||||
class Application(web.Application):
|
class Application(web.Application):
|
||||||
DEFAULT: Application = None
|
DEFAULT: Application = None
|
||||||
|
|
||||||
def __init__(self, cfgpath: str | None):
|
def __init__(self, cfgpath: str):
|
||||||
web.Application.__init__(self,
|
web.Application.__init__(self,
|
||||||
middlewares = [
|
middlewares = [
|
||||||
handle_api_path
|
handle_api_path
|
||||||
|
|
|
@ -7,7 +7,6 @@ import typing
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from platformdirs import user_config_dir
|
|
||||||
|
|
||||||
from .misc import IS_DOCKER
|
from .misc import IS_DOCKER
|
||||||
|
|
||||||
|
@ -52,7 +51,7 @@ if IS_DOCKER:
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
def __init__(self, path: str, load: bool = False):
|
def __init__(self, path: str, load: bool = False):
|
||||||
self.path = Config.get_config_dir()
|
self.path = Path(path).expanduser().resolve()
|
||||||
|
|
||||||
self.listen = None
|
self.listen = None
|
||||||
self.port = None
|
self.port = None
|
||||||
|
@ -83,24 +82,6 @@ class Config:
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_config_dir(path: str | None = None) -> Path:
|
|
||||||
if path:
|
|
||||||
return Path(path).expanduser().resolve()
|
|
||||||
|
|
||||||
dirs = (
|
|
||||||
Path("relay.yaml").resolve(),
|
|
||||||
Path(user_config_dir("activityrelay"), "relay.yaml"),
|
|
||||||
Path("/etc/activityrelay/relay.yaml")
|
|
||||||
)
|
|
||||||
|
|
||||||
for directory in dirs:
|
|
||||||
if directory.exists():
|
|
||||||
return directory
|
|
||||||
|
|
||||||
return dirs[0]
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def sqlite_path(self) -> Path:
|
def sqlite_path(self) -> Path:
|
||||||
if not os.path.isabs(self.sq_path):
|
if not os.path.isabs(self.sq_path):
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
|
|
||||||
#content
|
#content
|
||||||
-block content
|
-block content
|
||||||
|
|
||||||
#footer.section
|
|
||||||
.col1
|
|
||||||
.version
|
|
||||||
%a(href="https://git.pleroma.social/pleroma/relay")
|
|
||||||
ActivityRelay/{{version}}
|
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
%p
|
%p
|
||||||
You may subscribe to this relay with the address:
|
You may subscribe to this relay with the address:
|
||||||
%a(href="https://{{domain}}/actor") << https://{{domain}}/actor</a>
|
%a(href="https://{{domain}}/actor") << https://{{domain}}/actor</a>
|
||||||
|
%p
|
||||||
|
To host your own relay, you may download the code at
|
||||||
|
%a(href="https://git.pleroma.social/pleroma/relay") << git.pleroma.social/pleroma/relay
|
||||||
|
|
||||||
-if config["whitelist-enabled"]
|
-if config["whitelist-enabled"]
|
||||||
%p.section.message
|
%p.section.message
|
||||||
|
|
|
@ -43,30 +43,30 @@ p:not(:last-child) {
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border: 1px solid var(--primary);
|
|
||||||
border-radius: 5px;
|
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
|
/* border-radius: 10px; */
|
||||||
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
table tbody tr:nth-child(even) td {
|
td {
|
||||||
background-color: var(--section-background);
|
border: 1px solid var(--primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
thead td:first-child {
|
/*thead td:first-child {
|
||||||
border-top-left-radius: 3px;
|
border-top-left-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
thead td:last-child {
|
thead td:last-child {
|
||||||
border-top-right-radius: 3px;
|
border-top-right-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody tr:last-child td:first-child {
|
tbody tr:last-child td:first-child {
|
||||||
border-bottom-left-radius: 5px;
|
border-bottom-left-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody tr:last-child td:last-child {
|
tbody tr:last-child td:last-child {
|
||||||
border-bottom-right-radius: 5px;
|
border-bottom-right-radius: 10px;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
table td {
|
table td {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -111,15 +111,6 @@ table tbody td {
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: auto auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#footer .version {
|
|
||||||
text-align: right
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
color: var(--message-text) !important;
|
color: var(--message-text) !important;
|
||||||
|
@ -131,7 +122,7 @@ table tbody td {
|
||||||
background-color: var(--section-background);
|
background-color: var(--section-background);
|
||||||
padding: var(--spacing);
|
padding: var(--spacing);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 5px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section:not(:first-child) {
|
.section:not(:first-child) {
|
||||||
|
|
|
@ -59,10 +59,10 @@ def check_alphanumeric(text: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
@click.group('cli', context_settings={'show_default': True}, invoke_without_command=True)
|
@click.group('cli', context_settings={'show_default': True}, invoke_without_command=True)
|
||||||
@click.option('--config', '-c', help='path to the relay\'s config')
|
@click.option('--config', '-c', default='relay.yaml', help='path to the relay\'s config')
|
||||||
@click.version_option(version=__version__, prog_name='ActivityRelay')
|
@click.version_option(version=__version__, prog_name='ActivityRelay')
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx: click.Context, config: str | None) -> None:
|
def cli(ctx: click.Context, config: str) -> None:
|
||||||
ctx.obj = Application(config)
|
ctx.obj = Application(config)
|
||||||
|
|
||||||
if not ctx.invoked_subcommand:
|
if not ctx.invoked_subcommand:
|
||||||
|
|
|
@ -5,7 +5,6 @@ import typing
|
||||||
from hamlish_jinja.extension import HamlishExtension
|
from hamlish_jinja.extension import HamlishExtension
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
from . import __version__
|
|
||||||
from .database.config import THEMES
|
from .database.config import THEMES
|
||||||
from .misc import get_resource
|
from .misc import get_resource
|
||||||
|
|
||||||
|
@ -42,7 +41,6 @@ class Template(Environment):
|
||||||
new_context = {
|
new_context = {
|
||||||
'view': view,
|
'view': view,
|
||||||
'domain': self.app.config.domain,
|
'domain': self.app.config.domain,
|
||||||
'version': __version__,
|
|
||||||
'config': config,
|
'config': config,
|
||||||
'theme': THEMES.get(config['theme'], THEMES['default']),
|
'theme': THEMES.get(config['theme'], THEMES['default']),
|
||||||
**(context or {})
|
**(context or {})
|
||||||
|
|
|
@ -6,7 +6,6 @@ barkshark-sql@https://git.barkshark.xyz/barkshark/bsql/archive/0.1.1.tar.gz
|
||||||
click>=8.1.2
|
click>=8.1.2
|
||||||
hamlish-jinja@https://git.barkshark.xyz/barkshark/hamlish-jinja/archive/0.3.5.tar.gz
|
hamlish-jinja@https://git.barkshark.xyz/barkshark/hamlish-jinja/archive/0.3.5.tar.gz
|
||||||
hiredis==2.3.2
|
hiredis==2.3.2
|
||||||
platformdirs==4.2.0
|
|
||||||
pyyaml>=6.0
|
pyyaml>=6.0
|
||||||
redis==5.0.1
|
redis==5.0.1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue