-
Notifications
You must be signed in to change notification settings - Fork 987
Getting started
Welcome to our Wiki for Streama v1 of the app! On this page you will find deployment info (mainly for Linux) as well as FAQs.
Here is a video Tutorial of @dularion setting it up: http://www.youtube.com/watch?v=GUcbVTrdNv8
Below you can find a step-by-step.
Get and install Java 8 (JDK or JRE). OpenJDK is a preferred JDK.
Download the latest war from the releases page, for instance by using the terminal command wget https://github.com/dularion/streama/releases/download/v1.0.21/streama-1.0.21.war
into the same directory. Suggestion: use /data/streama
for the yml and the war and /data/streama/files
for the uploaded files.
Run the app using sudo ./streama-[version].war
or the failsafe option java -jar streama-[version].war
. Once you see the console output
Grails application running at http://localhost:8080 in environment: production
you are set to go! just navigate to localhost:8080 and you will see a login screen (default = username:admin, password:admin), and the program is up and running. Enjoy! :)
This is a step-by-step to migrate from a previous version to current.
We can tell this a few different ways. If you see "streama.mv.db" and "streama.trace.db" files, prior to downloading the newer version, you're likely using the Java H2 database type (and NOT MySQL).
However if you do not see those files in the same directory as streama, then run:
mysql -u <USER> -p <PASSWORD>
to log into MySQL console. From there, run:
show databases
and you should see a streama database. So that means you're using MySQL.
Configure the application.yml file to use either the flat files (streama.mv.db, etc) OR the MySQL option. If you do need to use MySQL, you must comment out the "org.h2.Driver" section. If you use the MySQL section, you must put in the login and password for Streama.
Go to the web interface at [IP address]:8080 , and log in. Now check that your settings are appropriately ported. If they are not, stop Streama and verify that the application.yml is pointing at the correct type of Database, and that it can log in.
ℹ️ If something didn't work or you want to improve the workflow, see FAQs below.
- 1. The .war file is not executable
- 2. Where is the data stored?
- 3. How do i install java?
- 4. How do I hook in my existing file system
- 5. Automatic Video Conversion
- 6. When restarting the app, the data is gone
- 7. How to run in background
- 8. How do I change the port?
- 10 How do I install it as a service?
- 11 Video playback
- 12 How to use SQL instead of H3 as a datastore
If your .war file isnt executable after download, just change the permissions with sudo chmod u+x streama-1.x.x.war
.
ℹ️ How is this concept of an executable .war even possible? Internally, the application uses gradle and a plugin called gradle-boot. This plugin together with the overall setup of the application allows for the .war file to executable all by itself!
Protip: For a professional linux setup, use this feature to create a system service and run it by calling sudo service streama start/stop/restart
:)
By default, the data is stored in an embedded, persistent database called H2. This database persists the data into a file adjacent to the .war file that was executed.
If you prefer the security of a mysql setup, use the sample application.yml to configure the mysql connection.
If your MySQL differs from the default 'root'@'localhost' with database 'streama' then you can just change those values in the application.yml. When running the app using ./streama-[version].war
make sure that the application.yml is named correctly resides in the same directory as the .war file.
Make sure you got java8 up and running in your command line. Using OpenJDK works just fine! the below works for ubuntu. sudo apt-get install openjdk-8-jdk
Thanks to @jendib you can now use the "Local Video Files" Directory in the settings page! Just point it to the root directory of your media collection and you will have a nifty file-browser showing a manage-files popup for each episode/movie
Auto-Conversion is still something that I want to see for streama, but there is so much to consider when it comes to self-hosted instances, such as CPU-power for conversion, local dependencies such as ffmpeg, potentially using nodejs as the crawler/worker ... I am still planning this and trying to figure out a way to make it as comfortable to host as possible, but for now it is still up to you to convert videos into html5.
Don't worry, the data isn't lost, in fact it is persisted to a file called Streama.db. You just need to make sure to always start the app from the same directory each time. The easiest is to always start it from inside the folder or using systemctl.
easiest is by installing something like byobu or screen and running it in one of the tabs :) Alternatively, you can configure the programme as a service via init.d. There are several tutorials for that online for your perusal :)
You need to use application.yml alongside the war file. here is a sample application.yml for you to work off of.
now with the executable war, you can just add the application as a service to systemctl (ubuntu 15+).
# go to the app directory, for example
cd /data/streama
# create link
ln -s streama-[version].war streama.war
# create the systemctl service
vim /etc/systemd/system/streama.service
# start streama.service content
[Unit]
Description=streama
After=syslog.target
[Service]
User=[USER TO RUN APP]
ExecStart=/data/streama/streama.war
SuccessExitStatus=143
ConditionPathExists=/data/streama/streama.war
# end streama.service content
[Install]
WantedBy=multi-user.target
# then enable the service
sudo systemctl enable streama.service
# then just run
sudo systemctl start streama.service
if your videos won't play or you don't have any sound, make sure that they are HTML5 compatible. I will add video-conversion soon, but right now there is no conversion, so you have to rely on what your browser can handle. A quick and easy test is to open a new empty browser-tab and drag&drop your video file in. If it shows up in a player, then it's a compatible format. If it downloads, it's incompatible. The format that is most compatible is h264 for video and aac for audio.
Try this: ffmpeg -i input.mkv -vcodec h264 -acodec aac -strict -2 output.mp4
You need to use application.yml alongside the war file. here is a sample application.yml for you to work off of. Here, just uncomment the sql-lines and comment out the h3 lines!