Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to alter receive URL path? #117

Open
MightyGorilla opened this issue Sep 13, 2024 · 5 comments
Open

Possibility to alter receive URL path? #117

MightyGorilla opened this issue Sep 13, 2024 · 5 comments

Comments

@MightyGorilla
Copy link

First of all, this is a great project & thanks for your work!

We have an existing AS2 system and I was investigating the possibility of just moving our keys and certs and then updating our DNS and not having to send a different endpoint URL out to partners. Is there a supported/reasonable way to alter the directory portion of the URL or is that a dumb idea?

For example changing:
http://myserver.com:5080/pyas2/as2receive to something like http://myserver.com:5080/inbound

Thanks
Travis-

@chadgates
Copy link
Contributor

chadgates commented Sep 14, 2024

@MightyGorilla : just change the urls.py of the django project to something like this:

`
from django.contrib import admin
from django.urls import path, include
from yourProjectName.views import Home
from pyas2.views import ReceiveAs2Message
from django.conf import settings

urlpatterns = [
path('whateveryoursiteaminlinkis/', admin.site.urls),
path('pyas2/', include('pyas2.urls')),
path('', Home.as_view(), name='home'),
path('inbound/', ReceiveAs2Message.as_view(), name="as2-receive"),
# Add the url again without slash for backwards compatibility
path('inbound', ReceiveAs2Message.as_view(), name="as2-receive"),
path('accounts/', include('django.contrib.auth.urls')),
]
`

More about URLs is here: https://docs.djangoproject.com/en/4.1/topics/http/urls/ (I suggest to use django version < 4.2 - there are issues).

@MightyGorilla
Copy link
Author

@chadgates Thanks!
I didn't see a lot in the issues list, so concerning the suggestion of using v4.1 or less: Is that related to the cryptography lib dependency still needing to be patched, or something else? ....or several somethings else? ;)

@chadgates
Copy link
Contributor

I get issues with Posix Path/Default Storage and Suspicious File Operations under 4.2 ... but it might be just my setup...

@chadgates
Copy link
Contributor

@MightyGorilla : The Django >=4.2 thingy - I investigated and found following to be the case depending on if you set DATA_DIR or not:

  • if you don't have DATA_DIR setup, you will probably not have any issues with any version of Django.
  • If you did setup DATA_DIR and if DATA_DIR!=MEDIA_ROOT you will have problems for sure (also in 3.x).
  • If you have DATA_DIR == MEDIA_ROOT, then you will have issues with Django >= 4.2.14.

I tried a PR #119 ... let's see ...

@MightyGorilla
Copy link
Author

Thanks for the detail (and the fix)! I patched our install with your update- I still need to setup a another instance to send some traffic between the two to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants