### Run nginx ignition with Docker Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/README.md This command starts the nginx ignition application using Docker. It maps ports 8090 (application) and 80 (Nginx) from the container to the host machine. Ensure Docker is installed before running this command. ```shell docker run -p8090:8090 -p80:80 dillmann/nginx-ignition ``` -------------------------------- ### Password Reset Log Output - Text Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/troubleshooting.md This snippet shows an example of the log output after a successful password reset in nginx-ignition. It indicates the completion of the password reset for a specific user and displays the newly generated password. This log message is crucial for confirming that the password reset operation was successful. ```text 2025-03-29T18:15:02.291-0300 INFO Password reset completed successfully for the user admin. New password: 0bd2189e ``` -------------------------------- ### Migrating Nginx Ignition Database Environment Variables (Shell) Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/migration-guide.md This snippet demonstrates the migration of Nginx Ignition database connection environment variables from version 1.x to 2.0.0. It shows how `NGINX_IGNITION_DATABASE_URL`, `NGINX_IGNITION_DATABASE_USERNAME`, and `NGINX_IGNITION_DATABASE_PASSWORD` are replaced by more specific variables like `NGINX_IGNITION_DATABASE_HOST`, `NGINX_IGNITION_DATABASE_DRIVER`, `NGINX_IGNITION_DATABASE_PORT`, `NGINX_IGNITION_DATABASE_NAME`, and `NGINX_IGNITION_DATABASE_SSL_MODE`. ```shell # Before migration (version 1.x) NGINX_IGNITION_DATABASE_URL="jdbc:postgresql://192.168.1.150:5432/my_custom_db" NGINX_IGNITION_DATABASE_USERNAME="my_username" NGINX_IGNITION_DATABASE_PASSWORD="supersecretpassword" # After migration (version 2.0.0) NGINX_IGNITION_DATABASE_HOST=192.168.1.150 NGINX_IGNITION_DATABASE_DRIVER=postgres NGINX_IGNITION_DATABASE_PORT=5432 NGINX_IGNITION_DATABASE_NAME=my_custom_db NGINX_IGNITION_DATABASE_SSL_MODE=disable NGINX_IGNITION_DATABASE_USERNAME=my_username NGINX_IGNITION_DATABASE_PASSWORD=supersecretpassword ``` -------------------------------- ### Set Password Reset Username - Shell Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/troubleshooting.md This snippet demonstrates how to set the NGINX_IGNITION_PASSWORD_RESET_USERNAME environment variable in a shell environment to reset a user's password. When the application starts with this variable set, it generates a new random password for the specified user and logs it before shutting down. This is a temporary measure for password recovery. ```shell NGINX_IGNITION_PASSWORD_RESET_USERNAME= # Example NGINX_IGNITION_PASSWORD_RESET_USERNAME=admin ``` -------------------------------- ### Connect Nginx Ignition to PostgreSQL Database Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/configuration-properties.md Establish a connection between Nginx Ignition and a PostgreSQL database. This involves setting several environment variables to specify database driver, host, port, name, SSL mode, username, and password. Nginx Ignition automatically manages table creation and schema updates. Example shows configuration for a PostgreSQL instance at `192.168.1.150`. ```shell NGINX_IGNITION_DATABASE_DRIVER=postgres NGINX_IGNITION_DATABASE_HOST=192.168.1.150 NGINX_IGNITION_DATABASE_PORT=5432 NGINX_IGNITION_DATABASE_NAME=my_custom_db NGINX_IGNITION_DATABASE_SSL_MODE=disable NGINX_IGNITION_DATABASE_USERNAME=my_username NGINX_IGNITION_DATABASE_PASSWORD=supersecretpassword ``` -------------------------------- ### Define Custom JWT Secret for Nginx Ignition Security Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/configuration-properties.md Configure a custom JSON Web Token (JWT) secret for Nginx Ignition. This secret must be a 64-character string used for signing JWTs, ensuring secure user authentication. If not provided, a random secret is generated on each boot, forcing re-login. Example demonstrates setting the `NGINX_IGNITION_SECURITY_JWT_SECRET` environment variable. ```shell NGINX_IGNITION_SECURITY_JWT_SECRET="e54rVg9NX5moIP6k2xmUwT0bauAG7pvkR7XI7ygJ6jz0T50huvujCdW4ym6mOjAy" ``` -------------------------------- ### Restore PostgreSQL DB using psql Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/database-restore-guide.md This snippet demonstrates how to restore a PostgreSQL database using the `psql` command-line client. It requires the host, port, username, database name, and the path to the SQL dump file. The application container should be stopped before executing the restore to prevent data corruption. ```bash docker stop psql --host= --port=5432 --username= --dbname= --file=/path/to/nginx-ignition.sql docker start ``` -------------------------------- ### Restore SQLite DB via Docker Bind Mount Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/database-restore-guide.md This snippet illustrates restoring an SQLite database when using a Docker bind mount for the data directory. The steps involve stopping the container, replacing the database file on the host system within the bind-mounted directory, and then restarting the container. ```bash docker stop cp /path/to/nginx-ignition.db /path/to/bind/mount/nginx-ignition.db docker start ``` -------------------------------- ### Restore SQLite DB to Docker Container Source: https://github.com/lucasdillmann/nginx-ignition/blob/main/docs/database-restore-guide.md This snippet shows how to restore an SQLite database file into a running Docker container. It assumes the container is named 'nginx-ignition' and the database file is located at '/opt/nginx-ignition/data/nginx-ignition.db'. The process involves stopping the container, copying the backup file, and then restarting the container. ```bash docker ps docker stop nginx-ignition docker cp /path/to/nginx-ignition.db nginx-ignition:/opt/nginx-ignition/data/nginx-ignition.db docker start nginx-ignition ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.