-
Notifications
You must be signed in to change notification settings - Fork 1
Updater
OpenFLIXR is a "managed" system that comes with a weekly updater that runs every week at 2 AM on Saturday for the timezone you have set. You can also run the updater script manually by running sudo bash /opt/openflixr/updateof
in your preferred terminal.
The updater supports custom commands and scripts that get run at the end of the update process and allows for the adding to this process. By default, you have to edit and maintain /opt/openflixr/userscript.sh
yourself. However, as of September 23, 2019, an easier process has been added using the setupopenflixr
script; details can be found below.
You can customize the update process by using custom scripts that run at the end of the update using the information below.
To use this and initialize the structure, you will need to have done one of the following:
- Gone through the FirstRun or ran
setupopenflixr
the for first time the after September 23, 2019 - If you have already run and completed
setupopenflixr
once, you can do the following to get this initialized:- Run
setupopenflixr
- Choose the "Fixes & Other Stuff" menu option
- Choose the "Select specific fix to run" menu option
- Choose "Run updater fix"
- Run
Any user scripts you want to run should be executable shell scripts (.sh) located in ~/.openflixr/userscripts/
. These scripts run in the lexical sort order (according to the C/POSIX locale character collation rules) of their names.
After initializing, you will see a scriptin ~/.openflixr/userscripts/
called 20_nginx.sh
(see below for more information about this file). Add any other scripts you want to run in this directory and they will run at the end of the updater. They can be named anything you want so long as they end with .sh
and are executable.
Note that ~/.openflixr/userscripts.sh
or ~/.openflixr/userscripts/nginx.sh
will NOT be overwritten any time setupopenflixr
is run and any changes made to them will be kept. If at any point either of these files gets messed up from changes you made, you can delete the file and run the initializing steps above or setupopenflixr -f updater
to recreate the original file(s); no other files will be removed or changed.
If at any point you need to make sure the permissions are correct, you can run run the initializing steps above or setupopenflixr -f permissions
.
A good example of this is if you want to add additional applications and access them through the reverse proxy. You can do this by adding a .block
file to the directory ~/.openflixr/userscripts/.nginx/
. The 20_nginx.sh
will find these block files and then have them added to the openflixr reverse proxy each time that the updater runs.
This file would be located at ~/.openflixr/userscripts/.nginx/airsonic.block
Note the extra blank line at the end.
location /airsonic {
proxy_pass http://127.0.0.1:4040/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
You can see another example of how this works by looking at /opt/OpenFLIXR2.SetupScript/.scripts/userscript.sh
. This is a script maintained by setupopenflixr
for various fixes that need to be in place, especially for updating Ubooquity properly.
If at any point you want to run these manually without running the updater, you can run either of the following commands depending on your needs:
- Run only the local custom scripts
sudo bash ~/.openflixr/userscript.sh
- Run the updater's userscript file, which will also run the above
sudo bash /opt/openflixr/userscript.sh
- Run the weekly update script, which will also run the all of the above
sudo bash /opt/openflixr/updateof