I checked quite a few stackoverflow questions about this and none doesn't seem to be the exact case as me and didn't really work for me so posting this question. So I'm trying to setup weblate using docker which wants me to set weblate email host user, password etc. to send mails to users when using the site, my current docker-compose.override.yml looks like this:
version: '3'
services:
weblate:
ports:
- 1111:8080
environment:
WEBLATE_EMAIL_HOST: smtp.mymailserver.com
WEBLATE_EMAIL_PORT: 465
WEBLATE_EMAIL_HOST_USER: translate#domain.com
WEBLATE_EMAIL_HOST_PASSWORD: password
WEBLATE_SERVER_EMAIL: translate#domain.com
WEBLATE_DEFAULT_FROM_EMAIL: translate#domain.com
WEBLATE_SITE_DOMAIN: translate.mydomain.com
WEBLATE_ADMIN_PASSWORD: mypass
WEBLATE_ADMIN_EMAIL: myemail#domain.com
I checked this with gmail app in mobile with the same outgoing server configuration and it worked perfectly fine there (I was able to send mails from it) but whenever I try it with weblate, I'm seeing this error:
SMTPAuthenticationError: (535, b'Authentication credentials invalid')
This is the whole error I get in the logs
You don't have SSL enabled, that might be reason for server rejecting the crendentials. Try enabling WEBLATE_EMAIL_USE_SSL.
PS: In the upcoming release, this will be turned on automatically for port 465, see https://github.com/WeblateOrg/weblate/commit/efacbf5d7e36c7207e985744639564e7edfc2fbb
Related
I was trying to implement 'Securing Django Admin login with OTP', however I can't login into the admin panel now. I removed the app from everywhere but still doesn't work. Any solution for this?
[05/Feb/2021 21:39:49] code 400, message Bad request version ('î\x9el\x00$\x13\x01\x13\x03\x13\x02À+À/̨̩À,À0À')
[05/Feb/2021 21:39:49] You're accessing the development server over HTTPS, but it only supports HTTP.
If you are on development version you cant use https connection on your localhost so just turn your URL to http and error will be disappear.
ex:
https://localhost:8000
or
https://127.0.0.1:8000
just turn it to
http://localhost:8000
or
http://127.0.0.1:8000
also may be at 127.0.0.1:8000
I know that there are a lot of answers to this issue say that I should probably try running my server on another port like so: python manage.py runserver 0.0.0.0:8080 I have tried that didn't fix it. I have turned off my windows Norton firewall:
I have started PyCharm as administrator. The thing that make me think these solutions were not going to work for me was that other API endpoints work fine: http://localhost:8000/accounts/login/ works and http://localhost:8000/accounts/logout/ works too. But when I fill out the form and POST my data to http://localhost:8000/accounts/signup I get this error:
OSError at /accounts/signup/
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/signup/
Django Version: 2.2.7
Exception Type: OSError
Exception Value:
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
Can someone please tell me what I am missing here?
You are using the wrong system for mailing ! for test and in localhoset set it as below:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
in settings.py
Encountered the same issue with an identical setup.
Apparently has something to do with sending a confirmation email.
Turning off email verification fixed the problem for me:
# settings.py
ACCOUNT_EMAIL_VERIFICATION = "none"
I've developed my own website on Django for a while, and today I started to learn how to deploy it. I added this to my settings.py:
SECURE_SSL_REDIRECT = True,
This caused the development server to stop working properly, with this error message:
[13/Jan/2018 16:56:49] code 400, message Bad request syntax ('\x16\x03\x01\x00À\x01\x00\x00¼\x03\x03ßà\x84¼+Jnßþn-ñ\x88ý©vAþK\x83¤²êT\x86\x0b.\x8em\x0b:â\x00\x00\x1cÚÚÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
[13/Jan/2018 16:56:49] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00À\x01\x00\x00¼\x03\x03\x87')
[13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP.
[13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP.
[13/Jan/2018 16:56:49] code 400, message Bad request version ('JJÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
[13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP.
Why has my server stopped working properly?
Note that when I changed the setting back to SECURE_SSL_REDIRECT = False, the problem didn't go away.
You configured your django site to enforce https by setting SECURE_SSL_REDIRECT = True - which is very good idea for a production setup.
If you set the SECURE_SSL_REDIRECT setting to True, SecurityMiddleware will permanently (HTTP 301) redirect all HTTP connections to HTTPS.
For this reason (and also others) you usually have separate settings for development and produciton. There are a few things that nearly always differ.
Read this to get known to some approches on how to deal with it: Django: How to manage development and production settings?
NOTE
If your browser received 301 once from your site - changing the setting back might have no direct effect, as the browser cached the target URL and does not send a request on HTTP. You need to clear or disable your browsers cache in that case.
The browser has cached the http->https redirect from the previous request when it was working with SECURE_SSL_REDIRECT=True.
Turning it off server side will not effect that cached redirect.
You can selectively clear that for your dev server's url/ip (not everything in the browser cache) and get things working by:
Shutdown your Django dev server
Go to http://127.0.0.1:8000 - it will give you a 404
Open up Chrome's dev tools
Click and hold on the "Reload" button
Select: "Empty Cache & Hard Reload"
Restart Django dev server
Hit http://127.0.0.1:8000 again
If you are part of a team, you can use a variable to set the development environment. for e.g. DJANGO_DEV=development
After that you can check, if current environment is a DEV env and set the specific values.
Read more about this approach on this answer
You might try editing your Edit Configuration and run the server on a different port. In pycharm I changed run -> edit_configurations -> host = 127.0.0.1, Port = 8001.
I then reran the Python Interpreter and it launched again in a new browser without the https. You might need to first change the settings options to select SECURE_SSL_REDIRECT = False in your local_settings or settings.
I have setup redmine and configure email sending feature with smtp.
It takes around 15 seconds for any user action to complete if email is enabled( sending email takes time at our smtp server as it has a configured delay).
So I have tried using async_smtp as shown below.
production:
delivery_method: :async_smtp
async_smtp_settings:
enable_starttls_auto: true
address: "smtp.xxx.com"
port: 25
domain: "smtp.xx.com"
authentication: :plain
user_name: "yyy#xxx.com"
password: "xxx!"
Redmine shows that email is sent, but I couldn't see the email. Log also doesn't show any error.
Can someone help?
Adding more detail below:
with the above settings, I get success log as shown below:
Sent email "Redmine test" (16ms) to: [email]
Redirected to http://[ip]/redmine/settings?tab=notifications Completed 302 Found in
328ms (ActiveRecord: 0.0ms) Started GET
"/redmine/settings?tab=notifications" for [ip] at 2015-10-05 15:13:04+0530
note: I have replaced ip and email with [ip] and [email]
I made it work!
I found that you need to add extra level in the config file, email_delivery. Its hinted at elsewhere in the file, but all the examples on redmine.org miss it out. Seems that only async requires it.
production:
email_delivery:
delivery_method: :async_smtp
async_smtp_settings:
address: ...
It's look like it's the same problem I had, your smtp server can't reroute your request. I had to let my configuration to smtp instead of async_smtp as our smtp server can't handle it.
Is it your own smtp server or a hotmail, gmail, etc?
BTW can you try to add this config.action_mailer.logger = nil to your config/environments/production.rb configuration file, and give us the output of log/production.log
EDIT: Look like redmine have problem handling certain SSL certificate.
On production, I've been trying to add the djangosecure.middleware.SecurityMiddleware (from http://pypi.python.org/pypi/django-secure)to my settings, but haven't had any luck making it work.
When I run:
./manage.py checksecure
Everything passes perfectly fine. But I'm unable to load the site up. It gives me the following error:
The webpage has resulted in too many redirects. Clearing your cookies for this site or
allowing third-party cookies may fix the problem. If not, it is possibly a server
configuration issue and not a problem with your computer.
Locally, when I use the production settings I receive a page error with:
Unable to make a secure connection to the server. This may be a problem with the server,
or it may be requiring a client authentication certificate that you don't have.
My terminal then gets filled with strange errors that I can't decipher:
[12/Jan/2013 14:15:25] code 400, message Bad HTTP/0.9 request type
('\x16\x03\x01\x00\x98\x01\x00\x00\x94\x03\x02P\xf1\xc4]\x97e\xdd\xdc\xa9\xeb\x0e\xfc\xbb\xfa3 ')
[12/Jan/2013 14:15:25] "??P??]?e?ܩ????3 Ʀ?-?:?.E:?o?FH?" 400 -
[12/Jan/2013 14:15:25] code 400, message Bad request syntax ('\x16\x03\x01\x00\x98\x01\x00\x00\x94\x03\x02P\xf1\xc4]M\xeeA50\xfc\x15%\xc1\xa4\x02\xec\xf0\x1fO')
[12/Jan/2013 14:15:25] "??P??]M?A50?%????O" 400 -
[12/Jan/2013 14:15:25] code 400, message Bad request syntax ('\x16\x03\x01\x00\x98\x01\x00\x00\x94\x03\x01P\xf1\xc4]\x8eg\xbey\x155\xafiP5\x85r\xb4|\x8c\x
Any advice?
Infinite-redirects means you have set SECURE_SSL_REDIRECT to True, but in production your site runs behind an SSL-stripping proxy server, so Django can't tell that the request is already in fact SSL, so it continually tries to redirect to SSL. As noted in the linked docs, you need to figure out what header your proxy sets to indicate an externally-SSL request, and set the SECURE_PROXY_SSL_HEADER setting accordingly.
Using the production settings locally will not work because Django's development server does not support SSL. The strange terminal output is your browser trying to make an SSL handshake with a server that doesn't understand SSL.