mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 06:27:59 +00:00
add parameter for config location
This commit is contained in:
parent
e4de3081c0
commit
e1498a8d6e
|
@ -5,10 +5,17 @@ import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import aiohttp.web
|
import aiohttp.web
|
||||||
import yaml
|
import yaml
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="A generic LitePub relay (works with all LitePub consumers and Mastodon).",
|
||||||
|
prog="python -m relay")
|
||||||
|
parser.add_argument("-c", "--config", type=str, default="relay.yaml",
|
||||||
|
metavar="<path>", help="the path to your config file")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
def load_config():
|
def load_config():
|
||||||
with open('relay.yaml') as f:
|
with open(args.config) as f:
|
||||||
options = {}
|
options = {}
|
||||||
|
|
||||||
## Prevent a warning message for pyyaml 5.1+
|
## Prevent a warning message for pyyaml 5.1+
|
||||||
|
|
Loading…
Reference in a new issue