Compare commits

..
4 Commits
Author SHA1 Message Date
alicia c82822fd0f Seperated out from slidge directory 2024-04-11 13:40:28 -07:00
alicia a832edbbc6 Receive works! 2024-04-11 13:12:54 -07:00
alicia 5463ba385f Starting receive work 2024-04-10 19:32:57 -07:00
alicia b07162e059 Initial commit, can send but not receive 2024-04-10 18:41:03 -07:00
6 changed files with 8 additions and 47 deletions
-20
View File
@@ -1,20 +0,0 @@
# Maintainer instructions on how to update the docker container
Build the container
`docker build .`
Find the line in the output after the prod container has been built (it's the middle one after build and before dev), grab it's sha.
You can run `docker images` to check that it matches.
Tag the image
`docker tag codeberg.org/boxedtoast/slidgevoipms:latest <IMAGE ID>`
Login to codeberg (if you haven't already)
`docker login codeberg.org`
Push the image
`docker push codeberg.org/boxedtoast/slidgevoipms:latest`
+2 -1
View File
@@ -11,4 +11,5 @@ for general info on how to set up an XMPP server component.
### Containers
The container is available on codeberg. See the `docker-compose-prod.yml` for an example of how to pull it in.
Containers are not available on docker.io yet, but can be built locally from the Dockerfile.
The docker-compose.yml will bring up a development instance of slidge and prosody.
-11
View File
@@ -1,11 +0,0 @@
slidgevoipms:
image: codeberg.org/boxedtoast/slidgevoipms:latest
container_name: slidgevoipms
restart: unless-stopped
networks:
- xmpp # should be the same one as your XMPP server
volumes:
- ./slidgevoipms.conf:/etc/slidge/conf.d/slidgevoipms.conf:ro
- ./slidgevoipmsattachments:/slidge-web # attachment directory
- ./slidgevoipmsdata:/var/lib/slidge:rw # slidge databases
+2 -7
View File
@@ -11,7 +11,7 @@ from slidge import BaseGateway, FormField, GatewayUser
from slidge.command.register import RegistrationType
from slixmpp.exceptions import XMPPError
from .session import API_URL
from .session import ASSETS_DIR
class Gateway(BaseGateway):
@@ -57,13 +57,8 @@ class Gateway(BaseGateway):
'method': 'getDIDsInfo',
'content_type': 'json',
}) as response:
# For whatever cursed reason, this call sometimes returns with
# text/html as the content type, so we disable the check
try:
json = await response.json(content_type=None)
json = await response.json()
if json['status'] == 'success':
return
else:
raise XMPPError("Received error from voipms")
except:
raise XMPPError("Failure decoding response from voipms")
-4
View File
@@ -92,7 +92,6 @@ class Session(BaseSession[str, Contact]):
'all_messages': 1,
'content_type': 'json',
}) as response:
try:
json = await response.json()
log.debug(f"received messages from voipms {json}")
@@ -100,9 +99,6 @@ class Session(BaseSession[str, Contact]):
return []
else:
return json['sms']
except client_exceptions.ContentTypeError:
log.warning("Received non-json response from voipms")
return []
async def on_file(self, chat: Contact, url: str, **_kwargs):
f = self.user.registration_form