source of geminispace.info - the search provider for gemini space
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
1.1 KiB

import argparse
import jetforce
from . import app, gus
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--host",
help="Server address to bind to",
default="127.0.0.1"
)
parser.add_argument(
"--port",
help="Server port to bind to",
type=int,
default=1965
)
parser.add_argument(
"--hostname",
help="Server hostname",
default="localhost"
)
parser.add_argument(
"--tls-certfile",
dest="certfile",
help="Server TLS certificate file",
metavar="FILE",
)
parser.add_argument(
"--tls-keyfile",
dest="keyfile",
help="Server TLS private key file",
metavar="FILE",
)
return parser.parse_args()
def main():
args = parse_args()
server = jetforce.GeminiServer(
app=app,
host=args.host,
port=args.port,
hostname=args.hostname,
certfile=args.certfile,
keyfile=args.keyfile,
)
try:
server.run()
finally:
gus.searcher.close()
if __name__ == "__main__":
main()