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

Automated/unattended install #196

Open
Keeper-of-the-Keys opened this issue Jan 28, 2025 · 5 comments
Open

Automated/unattended install #196

Keeper-of-the-Keys opened this issue Jan 28, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@Keeper-of-the-Keys
Copy link
Contributor

Hey Ante,

I'm working on automating the installation of Viesti-Reports with ansible, but have some questions:

  1. Can I just generate a random string for APP_SECRET in .env.local or is more happening under the hood?
  2. Initial user creation I can probably just handle as an insert query in users

Additionally (and if you prefer I re-open this as a separate issue I totally understand!) - it seems that doctrine:migrations is ignoring the fact that I am using mariadb and tries to run the sqlite migrations and thus fails, this applies both to web ui and command line.

This is the relevant variable from .env.local (generated through the webui):
DATABASE_URL="mysql://vtest:REDACTED@localhost:3306/vtest?serverVersion=10.11.6-MariaDB-0+deb12u1"

This is the command I have tried to run:
php bin/console doctrine:migrations:migrate -q

Hoe dan ook heel erg bedankt voor dit mooie project.

@Keeper-of-the-Keys
Copy link
Contributor Author

Keeper-of-the-Keys commented Jan 29, 2025

Another note - in the webui when migrations fail there is no feedback to the user, it just goes back to the same screen.

I checked out main it could be that I am not on a "stable" version as a result.

// Edit - nvm:

smtp-test:~/test/Viesti-Reports$ git status
HEAD detached at v1.22.4

@Keeper-of-the-Keys
Copy link
Contributor Author

I was able to "work around" this issue by removing migrations/sqlite and creating a symlink sqlite > mysql, I'm not so familiar with symfony so I'm not sure where to look but it seems that there is something wrong in the db migrations selection logic.

@Keeper-of-the-Keys
Copy link
Contributor Author

I did some more digging today -
First I found that it seems that if I run update.sh again after the setup creates .env.local migrations succeed.

After more digging what I found is that php bin/console cache:clear needs to be run first.

I'll submit a PR with an updated README.md

@Keeper-of-the-Keys
Copy link
Contributor Author

I hope you don't mind me going all over the place like this -

Since DATABASE_URL in .env.local also contains the database version is there any mechanism that manages/updates that when the OS of the underlying server is updated? How important is it?

@antedebaas
Copy link
Owner

I don’t mind at all :)

In the end it’s a symfony caching issue. The whole setup has been a bit of a hack anyway.
So I’m gonna think on how to fix this :)

@antedebaas antedebaas added the bug Something isn't working label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants