Comments (5)
i will help you to setup this application
contact me https://www.fiverr.com/s/9W3PNA
from app.
Is this the same for the 4.6.x beta?
Seems to have no effect.
from app.
@muxo771 SimpleLogin doesn't currently support APPLICATION_ROOT
for 3.x or 4.6.x.
from app.
I had the same use case requirement to host SImpleLogin not under web server ROOT but another path. I spent a few hours yesterday afternoon to fix the code and achieved it. And today I stumbled upon this issue.
Disclaimer I have not done any serious Python programming before, other than being aware of its syntax. I know even less about Flask (didn't hear about it before), and what I did may not be the "right" way.
APPLICATION_ROOT
is a Flask thing, but it seems to be related to middle dispatcher, which SL does not use. Adding it may be quite a task.
What I did was simply adjusting the url_prefix
(adding the prefix I want) when registering the blueprints in server.py
(there are 10 blueprints) and prepending the prefix when adding the routes for the app (e.g. /favicon.ico
). Then all the generated URLs will have the correct /path
prefixes. I also changed the default "static" path to /path/static
to take care of serving the static files.
The remaining issues are the HTML templates have mixed references to /static
and /api
Some places are hard-coded with /static
while some use url_for('static')
. The latter generates the correct path. Same goes for the /api
path.
Then in nginx.conf
, I pass the /path
prefix from the URL to proxy_pass
so SL receives the expected full path.
Once that is all done, SL works as expected. Only a few "routes" are not changed, but they are related to functionality I don't care/need, like OpenID, Paddle, Coinbase, etc.
Hope this helps.
from app.
There is a thread on stackoverflow discussing the same issue: (https://stackoverflow.com/questions/67737069/how-to-host-a-flask-app-on-a-subfolder-url-prefix-with-nginx/75123044)
One solution seems to be simply as adding a couple new imports and then APPLICATION_ROOT
should work as intended.
Another one is adding a new argument to ProxyFix
in server.js
, which SL is already using. In nginx
configuration, be sure to add the trailing /
to proxy_pass
so that it will remove the prefix when passing the URL to the server. SL can then process all the URLs correctly.
On generating URL, Flask
will add the prefix as passed in via the X-Forwarded-Prefix
to all generated URLs. This takes care of most URLs from the application.
However, as mentioned, quite a few files in the templates are hard coded with /static
and /api
and they need to be changed with using url_for
as appropriate so that URLs are generated correctly.
I tested X-Forwarded-Prefix
set up and the app is working fine for the functionality I use. My Android client also works with API access once I update the server URL.
from app.
Related Issues (20)
- New fixes due to SL movement HOT 1
- Small fixes HOT 1
- cannot receive emails from Spotify HOT 1
- Sending signed emails are silently ignored
- Private vulnerability reporting ?
- FR: Recover Emails Sent to Deactivated Aliases
- Why not using Proton Captcha? HOT 1
- [BUG] simplelogin.co for directories?
- VueJS 2.x is deprecated and unmaintained
- Add some useful info
- No 'Delete Account' available HOT 1
- dkim customizations (bug: migration invalidates dkim signatures on previous emails)
- Add TOS notice on account activation
- del
- Coinbase Commerce Migration Concerns HOT 1
- Accessing admin views causes HTTP redirection loop in self-hosted environment HOT 2
- Web UI not opening HOT 1
- Integrating PGP Key Generation and Public Key Lookup in SimpleLogin
- Error in sender address transformation
- Ignore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app.