diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..257a08c8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# +# The above will handle all files NOT found below +# +# These files are text and should be normalized (Convert crlf => lf) +*.bat text eol=crlf +*.java text diff=java +*.sh text eol=lf diff --git a/client/.gitattributes b/client/.gitattributes deleted file mode 100644 index dfe07704..00000000 --- a/client/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/common/src/main/resources/xlink.xsd b/common/src/main/resources/xlink.xsd index 447a9f32..9a6fb0a2 100644 --- a/common/src/main/resources/xlink.xsd +++ b/common/src/main/resources/xlink.xsd @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/server/Dockerfile.txt b/server/Dockerfile.txt index ca6e8f2e..bb55be2a 100644 --- a/server/Dockerfile.txt +++ b/server/Dockerfile.txt @@ -1,33 +1,33 @@ -FROM alpine/git as open-m3u8Git -WORKDIR /app -RUN git clone https://github.com/0xboobface/open-m3u8.git - -FROM gradle:4.10-jdk10 as open-m3u8Build -WORKDIR /app/open-m3u8 -COPY --from=open-m3u8Git --chown=gradle:gradle /app /app -RUN gradle install - -FROM alpine/git as ctbrecGit -WORKDIR /app -RUN git clone https://github.com/0xboobface/ctbrec.git - -FROM maven:3-jdk-11-slim as ctbrecBuild -ARG ctbrec -ARG versionM3u8 -WORKDIR /app/master -COPY --from=ctbrecGit /app/ctbrec /app -COPY --from=open-m3u8Build /app/open-m3u8/build/libs/ /app/common/libs/ -RUN mvn clean install:install-file -Dfile=/app/common/libs/open-m3u8-${versionM3u8}.jar -DgroupId=com.iheartradio.m3u8 -DartifactId=open-m3u8 -Dversion=${versionM3u8} -Dpackaging=jar -DgeneratePom=true -RUN mvn clean -RUN mvn install - -FROM openjdk:12-alpine -WORKDIR /app -ARG memory -ARG version -ENV artifact ctbrec-server-${version}-final.jar -ENV path /app/server/target/${artifact} -COPY --from=ctbrecBuild ${path} ./${artifact} -EXPOSE 8080 -CMD java ${memory} -cp ${artifact} -Dctbrec.config=/server.json ctbrec.recorder.server.HttpServer - +FROM alpine/git as open-m3u8Git +WORKDIR /app +RUN git clone https://github.com/0xboobface/open-m3u8.git + +FROM gradle:4.10-jdk10 as open-m3u8Build +WORKDIR /app/open-m3u8 +COPY --from=open-m3u8Git --chown=gradle:gradle /app /app +RUN gradle install + +FROM alpine/git as ctbrecGit +WORKDIR /app +RUN git clone https://github.com/0xboobface/ctbrec.git + +FROM maven:3-jdk-11-slim as ctbrecBuild +ARG ctbrec +ARG versionM3u8 +WORKDIR /app/master +COPY --from=ctbrecGit /app/ctbrec /app +COPY --from=open-m3u8Build /app/open-m3u8/build/libs/ /app/common/libs/ +RUN mvn clean install:install-file -Dfile=/app/common/libs/open-m3u8-${versionM3u8}.jar -DgroupId=com.iheartradio.m3u8 -DartifactId=open-m3u8 -Dversion=${versionM3u8} -Dpackaging=jar -DgeneratePom=true +RUN mvn clean +RUN mvn install + +FROM openjdk:12-alpine +WORKDIR /app +ARG memory +ARG version +ENV artifact ctbrec-server-${version}-final.jar +ENV path /app/server/target/${artifact} +COPY --from=ctbrecBuild ${path} ./${artifact} +EXPOSE 8080 +CMD java ${memory} -cp ${artifact} -Dctbrec.config=/server.json ctbrec.recorder.server.HttpServer + diff --git a/server/docker-compose.yml b/server/docker-compose.yml index f9d5bc72..9825902b 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,9 +1,9 @@ - version: 3 - services: - ctbrec: - ports: - - '8080:8080' - volumes: - - 'ctbrec/config:/root/.config/ctbrec/' - - 'ctbrec/video:/root/ctbrec' + version: 3 + services: + ctbrec: + ports: + - '8080:8080' + volumes: + - 'ctbrec/config:/root/.config/ctbrec/' + - 'ctbrec/video:/root/ctbrec' image: bounty1342/ctbrec \ No newline at end of file diff --git a/server/src/main/resources/html/static/vendor/knockout-orderable/README.md b/server/src/main/resources/html/static/vendor/knockout-orderable/README.md index bd87a405..47a3a30e 100644 --- a/server/src/main/resources/html/static/vendor/knockout-orderable/README.md +++ b/server/src/main/resources/html/static/vendor/knockout-orderable/README.md @@ -1,45 +1,45 @@ -Knockout orderable binding -================== -This knockout binding allows to create sortable tables. It works by sorting items in observableArray, so tables rendered by "foreach" binding are automatically refreshed by knockout. - -##Design Goals - -###Focused only on ordering -Some other plugins take control of entire table rendering, making it complicated to build arbitrary tables. This plugin is only focused on sorting of observableArrays, leaving rendering of HTML to knockout. It gives freedom of using custom item templates for tables or lists. - -###Controllable from a view model -When binding applied for the first time it adds extra observables to a view model. So order can be changed programmatically like - - viewModel.people.orderDirection("desc") -or - - viewModel.people.orderDirection("lastName") - -###Minimal view model setup -There is nothing to be configured on a view model manually to use the plugin. Only bindings have to be set on elements which will trigger observableArray to be reordered. - -###Can be used with multiple observableArrays -Works well with multiple observableArray. oservableArrays can be ordered independently of each other. - - -##Usage -To make table header sortable set binding like this: - - First Name - -Default field to sort can also be provided: - - Age - -It's also possible to sort by nested attibutes by separating the attribute names with a dot (should work with array indices too): - - Pet name - -See full examples in examples folder. - -##Dependencies - - [jQuery](http://jquery.com/) - - [Knockout](http://knockoutjs.com/) - -##License -MIT license - [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) +Knockout orderable binding +================== +This knockout binding allows to create sortable tables. It works by sorting items in observableArray, so tables rendered by "foreach" binding are automatically refreshed by knockout. + +##Design Goals + +###Focused only on ordering +Some other plugins take control of entire table rendering, making it complicated to build arbitrary tables. This plugin is only focused on sorting of observableArrays, leaving rendering of HTML to knockout. It gives freedom of using custom item templates for tables or lists. + +###Controllable from a view model +When binding applied for the first time it adds extra observables to a view model. So order can be changed programmatically like + + viewModel.people.orderDirection("desc") +or + + viewModel.people.orderDirection("lastName") + +###Minimal view model setup +There is nothing to be configured on a view model manually to use the plugin. Only bindings have to be set on elements which will trigger observableArray to be reordered. + +###Can be used with multiple observableArrays +Works well with multiple observableArray. oservableArrays can be ordered independently of each other. + + +##Usage +To make table header sortable set binding like this: + + First Name + +Default field to sort can also be provided: + + Age + +It's also possible to sort by nested attibutes by separating the attribute names with a dot (should work with array indices too): + + Pet name + +See full examples in examples folder. + +##Dependencies + - [jQuery](http://jquery.com/) + - [Knockout](http://knockoutjs.com/) + +##License +MIT license - [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) diff --git a/server/src/main/resources/html/static/vendor/knockout-orderable/knockout.bindings.orderable.js b/server/src/main/resources/html/static/vendor/knockout-orderable/knockout.bindings.orderable.js index 0c6936c6..cc04bbb4 100644 --- a/server/src/main/resources/html/static/vendor/knockout-orderable/knockout.bindings.orderable.js +++ b/server/src/main/resources/html/static/vendor/knockout-orderable/knockout.bindings.orderable.js @@ -1,112 +1,112 @@ -ko.bindingHandlers.orderable = { - getProperty: function(o, s) { - // copied from http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key - s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties - s = s.replace(/^\./, ''); // strip a leading dot - var a = s.split('.'); - while (a.length) { - var n = a.shift(); - if (n in o) { - o = o[n]; - } else { - return; - } - } - return o; - }, - - compare: function (left, right) { - if (typeof left === 'string' || typeof right === 'string') { - return left ? left.localeCompare(right) : 1; - } - if (left > right) - return 1; - - return left < right ? -1 : 0; - }, - - sort: function (viewModel, collection, field) { - //make sure we sort only once and not for every binding set on table header - if (viewModel[collection].orderField() == field) { - viewModel[collection].sort(function (left, right) { - var left_field = ko.bindingHandlers.orderable.getProperty(left, field); - var right_field = ko.bindingHandlers.orderable.getProperty(right, field); - var left_val = (typeof left_field === 'function') ? left_field() : left_field; - right_val = (typeof right_field === 'function') ? right_field() : right_field; - if (viewModel[collection].orderDirection() == "desc") { - return ko.bindingHandlers.orderable.compare(right_val, left_val); - } else { - return ko.bindingHandlers.orderable.compare(left_val, right_val); - } - }); - } - }, - - init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { - //get provided options - var collection = valueAccessor().collection; - var field = valueAccessor().field; - - //add a few observables to ViewModel to track order field and direction - if (viewModel[collection].orderField == undefined) { - viewModel[collection].orderField = ko.observable(); - } - if (viewModel[collection].orderDirection == undefined) { - viewModel[collection].orderDirection = ko.observable("asc"); - } - - var defaultField = valueAccessor().defaultField; - var defaultDirection = valueAccessor().defaultDirection || "asc"; - if (defaultField) { - viewModel[collection].orderField(field); - viewModel[collection].orderDirection(defaultDirection); - ko.bindingHandlers.orderable.sort(viewModel, collection, field); - } - - //set order observables on table header click - $(element).click(function (e) { - e.preventDefault(); - - //flip sort direction if current sort field is clicked again - if (viewModel[collection].orderField() == field) { - if (viewModel[collection].orderDirection() == "asc") { - viewModel[collection].orderDirection("desc"); - } else { - viewModel[collection].orderDirection("asc"); - } - } - - viewModel[collection].orderField(field); - }); - - //order records when observables changes, so ordering can be changed programmatically - viewModel[collection].orderField.subscribe(function () { - ko.bindingHandlers.orderable.sort(viewModel, collection, field); - }); - viewModel[collection].orderDirection.subscribe(function () { - ko.bindingHandlers.orderable.sort(viewModel, collection, field); - }); - }, - - update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { - //get provided options - var collection = valueAccessor().collection; - var field = valueAccessor().field; - var isOrderedByThisField = viewModel[collection].orderField() == field; - - //apply css binding programmatically - ko.bindingHandlers.css.update( - element, - function () { - return { - sorted: isOrderedByThisField, - asc: isOrderedByThisField && viewModel[collection].orderDirection() == "asc", - desc: isOrderedByThisField && viewModel[collection].orderDirection() == "desc" - }; - }, - allBindingsAccessor, - viewModel, - bindingContext - ); - } -}; +ko.bindingHandlers.orderable = { + getProperty: function(o, s) { + // copied from http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key + s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties + s = s.replace(/^\./, ''); // strip a leading dot + var a = s.split('.'); + while (a.length) { + var n = a.shift(); + if (n in o) { + o = o[n]; + } else { + return; + } + } + return o; + }, + + compare: function (left, right) { + if (typeof left === 'string' || typeof right === 'string') { + return left ? left.localeCompare(right) : 1; + } + if (left > right) + return 1; + + return left < right ? -1 : 0; + }, + + sort: function (viewModel, collection, field) { + //make sure we sort only once and not for every binding set on table header + if (viewModel[collection].orderField() == field) { + viewModel[collection].sort(function (left, right) { + var left_field = ko.bindingHandlers.orderable.getProperty(left, field); + var right_field = ko.bindingHandlers.orderable.getProperty(right, field); + var left_val = (typeof left_field === 'function') ? left_field() : left_field; + right_val = (typeof right_field === 'function') ? right_field() : right_field; + if (viewModel[collection].orderDirection() == "desc") { + return ko.bindingHandlers.orderable.compare(right_val, left_val); + } else { + return ko.bindingHandlers.orderable.compare(left_val, right_val); + } + }); + } + }, + + init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { + //get provided options + var collection = valueAccessor().collection; + var field = valueAccessor().field; + + //add a few observables to ViewModel to track order field and direction + if (viewModel[collection].orderField == undefined) { + viewModel[collection].orderField = ko.observable(); + } + if (viewModel[collection].orderDirection == undefined) { + viewModel[collection].orderDirection = ko.observable("asc"); + } + + var defaultField = valueAccessor().defaultField; + var defaultDirection = valueAccessor().defaultDirection || "asc"; + if (defaultField) { + viewModel[collection].orderField(field); + viewModel[collection].orderDirection(defaultDirection); + ko.bindingHandlers.orderable.sort(viewModel, collection, field); + } + + //set order observables on table header click + $(element).click(function (e) { + e.preventDefault(); + + //flip sort direction if current sort field is clicked again + if (viewModel[collection].orderField() == field) { + if (viewModel[collection].orderDirection() == "asc") { + viewModel[collection].orderDirection("desc"); + } else { + viewModel[collection].orderDirection("asc"); + } + } + + viewModel[collection].orderField(field); + }); + + //order records when observables changes, so ordering can be changed programmatically + viewModel[collection].orderField.subscribe(function () { + ko.bindingHandlers.orderable.sort(viewModel, collection, field); + }); + viewModel[collection].orderDirection.subscribe(function () { + ko.bindingHandlers.orderable.sort(viewModel, collection, field); + }); + }, + + update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { + //get provided options + var collection = valueAccessor().collection; + var field = valueAccessor().field; + var isOrderedByThisField = viewModel[collection].orderField() == field; + + //apply css binding programmatically + ko.bindingHandlers.css.update( + element, + function () { + return { + sorted: isOrderedByThisField, + asc: isOrderedByThisField && viewModel[collection].orderDirection() == "asc", + desc: isOrderedByThisField && viewModel[collection].orderDirection() == "desc" + }; + }, + allBindingsAccessor, + viewModel, + bindingContext + ); + } +};