silas

joined 1 year ago
[–] [email protected] 1 points 10 months ago

BTW, I'm also written the backend. There are some examples on the web about solving this problem in the backend using cookies to keep track of the state. I'm give it a try.

[–] [email protected] 1 points 10 months ago (1 children)

Thanks for the reply. I was thinking about that, but in this specific case, changing back button behavior seem to improve user experience. See, for instance, Lemmy. IIRC, after submitting a new post, you are redirected to the post page you just submitted. If you press browser back button, you are taken to the community index page, not the submit form. How does Lemmy achieve this? Is it one single page, which content is changed by Javascript or, it is like my application, in which a full reload of the page is done?

[–] [email protected] 1 points 10 months ago (1 children)

Thanks. It seems these functions are useful in a SPA context? Since I'm reloading every page (I'm using plain HTML for most of this application) these functions seem not to be really useful for the purpose I wrote. Maybe I'm doing something wrong?

 

Hello all!

I'm a beginner in web development. I'm building a simple small library application for learning purposes that has processes such as:

  1. The landing page is an main index page with links to people page, books page, etc.
  2. Suppose the user clicks "books", it will be redirected to a page with a list of all registered books, let's call it "books index".
  3. The user can edit one of the books or click the "new" link. Both choices will redirect they to "edit-book" page, with a simple form that can be submitted.
  4. After submission, the user is redirected to the "books index" to edit or add another book.

In summary:

[1: index] -> [2: books index] -> [3: edit book form] -> [4: books index]

In step 4, if the user clicks the "back button" in browser, it is redirected to the form page. If they edited 20 books, they will be redirected to the form page 20 times. It is rather confusing, so I want they to be redirected to the main index page if they are on the books index page.

It seems I cannot just remove things from browser history with Javascript.

Do you have any suggestion? I'm thinking about just adding a "back" button in the page which works differently from the browser button, but it would still add stuff in history, which could make things even more confusing.

Thank you very much.

[–] [email protected] 1 points 10 months ago

Thanks for the reply. Yeah, I'll probably go that way once I get familiar with basic HTTP authentication in Spring.

 

Hello there.

I'm writing a simple REST API using Spring Boot and I just added basic HTTP authentication in it. I'm currently using Spring Boot 3.1.5 and Spring Security 6.1.5.

There are different instructions on the web about how to correctly setup basic HTTP authentication for web requests, I believe they differ according to the Spring Security version.

It seems that latest guides use implementations of the UserDetails interface, which I found rather confusing, as it is not clear for me how exactly the framework uses that. Instead, I found much easier and clear to write my own class that inherits from AuthenticationProvider and override its authenticate() method to do all fancy things for me, including checking and setting user roles.

I'd like to ask you if there is any drawback working with AuthenticationProvider that I cannot see right now, instead of newest documentation, that doesn't seem to just use default AuthenticationProvider.

Thanks!

 

Hi. I'm playing emulated Driver using pcsxr on Linux. Sometimes, when I'm being chased by three or more police cars for example, I'm observing a drop rate (from ~59 fps to ~45 fps). I first thought my computer (which is an old i3 540!), but I soon changed my mind because of two reasons:

  1. I was playing 1080p, but when I decreased resolution to 480p, this problem persisted.

  2. When I disabled emulator frame rate limiting, it jumped to ~120 fps and it dropped to only ~90 fps on other situations. Well, it is impossible to play the game in this situation as it seems you are playing in fast-forward mode.

Because of that, I thought that the game itself could be dropping frames in some situations. Maybe it is considering the limitations of original PS1 hardware and prefer to drop frames instead of delaying the game itself? If this is right, it is impossible to "fix" it changing the emulator configuration. Unfortunately I have no PS1 original hardware to test it myself.

Thanks!

P.S.: I recently discovered there is a Driver game for PC which seems to run much better, but now I'm past half of the PS1 version, so it is not worth to start it over again :-)

[–] [email protected] 1 points 1 year ago (1 children)

Pelo que entendi tem que copiar as configurações de group_vars/all.yml para inventories/<suamaquina>/group_vars/nas.yml e alterá-las nesse arquivo, conforme as suas necessidades né?

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (3 children)

Olha, eu aprendi tudo lendo a documentação oficial mesmo (em inglês). Mas passa aqui o erro que tá dando ou a dificuldade que você tá tendo, quem sabe a gente consegue te ajudar.

[–] [email protected] 3 points 1 year ago (1 children)

That is exactly what I'm looking now! Thanks! I'm actually new to this paradigm. How is it more secure than storing password in plain text? I mean, in your application, you'll have to store a token or something, so you can query Vault server, right? If an attacker have access to the server, it can query the Vault server with the token, retrieving relevant secrets, no?

[–] [email protected] 3 points 1 year ago (3 children)

Aqui tá normal.

[–] [email protected] 2 points 1 year ago (1 children)

Thanks. I would still have to store ansible-vault password locally or something like that, no?

[–] [email protected] 3 points 1 year ago (5 children)

Olás. Você já está escrevendo o próprio playbook ou está usando algo pronto? Sem trecho de código ou mensagens de erro fica difícil de saber qual o problema.

[–] [email protected] 2 points 1 year ago (6 children)

Thanks for the answer. I'm actually deploying to a local Linux server. Is there any tool I could use?

 

Hi. We successfully store secrets in ansible variables files with either ansible-vault or sops. It is a good approach when Ansible itself configures something that requires a secret, such as configuring a database admin password.

But I'd like to ask you about how you store secrets meant to be used by applications. Example: we have a an application in PHP with a config.php file with all credentials needed by the application. Developers have a config.php setup to work with the test environment, while we maintain a different config.php for production in production machines. Nowadays this config.php file is stored in ansible repository, encrypted by ansible-vault or sops. We thought about moving the config.php production file to the application repository, so we could get advantage of the CI/CD pipeline.

It doesn't smell right, because it would require to encrypt it somehow, and store keys to decrypt it in CI/CD, but I decided to ask you anyway what do you think of that and how you solved it yourselves.

Thanks!

 

The Pentel Smash mechanical pencil is usually compared to the Pentel Graphgear 1000, but I'd like to ask you comparing Smash to Graphgear 500.

Where I live, both are expensive mechanical pencils, but Smash is 70% more expensive and, IIUC, more professional. I'd like to know whether it pays to choose Smash over Graphgear 500 or both are kind of similar so I should go to Graphgear 500.

Do you know them? How do you compare both?

Thanks!

view more: next ›