-
Notifications
You must be signed in to change notification settings - Fork 126
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
Sidebar + Navbar Template #263
Comments
Hello and welcome to SQLPage! To get started, here are:
|
Wonderful, go ahead, I'll help you create a sidebar in the next few days |
That's fantastic! I appreciate your willingness to collaborate. If you have any questions or encounter any challenges while working on it, feel free to reach out. You can open a "draft" pull request as soon as you have something, and I'll be happy to review it and give you pointers if you get stuck. |
I managed to create a small sidebar draft #265 . |
I'm trying to configure nginx to use the reverse proxy on a VPS which works normally when pointing to "/", but if I try to access any endpoint like "/user.sql" it downloads the .sql file instead of opening the page, what can I do? Here is my vhost: server { server { {{nginx_access_log}} if ($scheme != "https") { location @reverse_proxy { {{settings}} add_header Cache-Control no-transform; index index.html; location ^~ /.well-known { location / { |
The In the provided configuration, the When a request is made for an endpoint like "/user.sql," Nginx interprets it as a file request and attempts to serve the file directly if it exists in the specified root directory. If the file exists, Nginx serves it, which is not the desired behavior. Therefore, you must ensure that Nginx doesn't serve files directly when handling requests meant for the reverse proxy. Adding a specific location block to handle requests for certain file extensions, like ".sql" in this case, can prevent Nginx from serving them directly and instead passing them to the reverse proxy. |
Wonderful, thank you. Is it possible to forward endpoints like "/usar.sql" to "/user" using rewriting in nginx? |
location ~ \.sql$ {
include my/proxy/conf;
}
location / {
try_files $uri @reverse_proxy;
}
location @reverse_proxy {
include my/proxy/conf;
} |
I sincerely thank you for your help! |
Yes, it's possible. See this previous discussion: #231 |
Incredible! I sincerely thank you for your great help. |
I use nginx served through CloudPanel, its vhost comes in this standard that I sent above, but I tried to add these configuration lines: location ~* ^(.).sql$ { It redirects to the page without the .sql, but gives a 404 error |
What you want is the opposite, isn't it? You want nginx to receive requests without .sql, and rewrite then to add .sql before forwarding them to SQLPage. |
In fact, I would like to call pages with .sql and nginx remove the .sql, for example /clientes.sql for /clientes |
You want your browser to show /clientes, and SQLPage to load the file clientes.sql. So you need nginx to rewrite the request sent by your browser from /clientes to /clientes.sql before forwarding it to SQLPage. This way, the user sees /clientes and SQLPage sees /clientes.sql. |
I added these lines to the vhost, but instead of directing to, for example, /users is directing to /users/ and SQLPage does not recognize these requests: Reescrever apenas as solicitações para arquivos .sql
|
In fact, discovering that requests, such as /users/ are going to users/.sql/index.sql, I believe it was my error in the rewriting. |
Here is an example nginx configuration rule: location / {
# When a request doesn't end with a '/' and doesn't have an extension, add '.sql' at the end
rewrite ^/((.*/)?[^/.]+)$ /$1.sql last;
proxy_pass http://localhost:8080;
} |
Wonder! It worked as expected, thank you again, from the bottom of my heart for your help! |
And a detailed explanation of how the |
Thank you very much! |
Can I now use SQLPage to create complex applications like a customer manager, for example? Application that communicates with APIs and databases, or is it too early for that? Is it safe for you to use it for this purpose? |
Hi ! If you want to get an idea of what can be built with sqlpage, you can have a look at this talk I gave at pgconf last december: https://www.youtube.com/watch?v=mXdgmSdaXkg A customer manager sounds very possible, but of course it will depend on your precise requirements. Communication with APIs is possible using fetch, and with databases... well... you will write your entire application in sql, so of course ! And if you get stuck, don't hesitate to ask for help here ! |
Wonderful, thank you from the bottom of my heart for the information and help! |
In the next update, would it be possible to implement some encryption functions, such as HMAC for example? |
Something like: Cargo.toml: Function:
|
Hello! This seems to be a different topic, maybe you can open a new feature request, where you present your project, and explain why you think a message signing function would be a good idea ? |
Got it, I'll take a look at the PGSQL functions. But my idea of use is that to use a certain API, I need to encrypt my password and pass it as HASH (via HMAC) to the endpoint. |
Searching around I found this function for MySQL and MariaDB:
|
I created a separate issue to avoid discussing it in this GitHub issue, which is about having a sidebar in the shell. Let's move the discussion about hmac to #303 |
Ok, thanks! |
It would be interesting to have the option to change the general template of the application, for example: Template with Sidebar + Navbar and Template with Navbar only
The text was updated successfully, but these errors were encountered: