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

Support other build targets #65

Closed
issuemover631 opened this Issue May 11, 2016 · 22 comments

Comments

Projects
None yet
4 participants
@issuemover631

issuemover631 commented May 11, 2016

Issue by EugeneKay
Wednesday May 11, 2016 at 00:17 GMT
Originally opened as Libresonic/libresonic#65


Historically only the WAR target has been built, because that is what I maintain for myself. Other targets(Windows EXE, OS X PKG, Debian/Ubuntu Deb, RedHat/Fedora RPM, Standalone JAR booter) would be good to have, but there is a lot of work that is needed before they can become official:

  • Package names must be changed to avoid potential conflicts(#52 is a start)
  • Documentation needs to be created for building against each OS
  • Automated build environment
  • Spring Boot(#142)
  • Rework packaging info to take advantage of new changes
@issuemover631

This comment has been minimized.

issuemover631 commented Oct 28, 2016

Comment by fxthomas
Friday Oct 28, 2016 at 21:04 GMT


Can I volunteer for this? I'd love to help setting up CI (Travis?), and I could even update the build process documentation in the meantime.

@issuemover631

This comment has been minimized.

issuemover631 commented Oct 28, 2016

Comment by EugeneKay
Friday Oct 28, 2016 at 21:50 GMT


Yes, please feel free. @zifnab06 had a Jenkins instance up at one point, but I don't know if that is current.

@issuemover631

This comment has been minimized.

issuemover631 commented Oct 28, 2016

Comment by fxthomas
Friday Oct 28, 2016 at 22:55 GMT


Thanks! For now I'm setting up Travis on my own repo, I'll let you know once it's ready. I'm actually not familiar with Jenkins, but the build process should be easy to port once I get it up and running.

@issuemover631

This comment has been minimized.

issuemover631 commented Oct 29, 2016

Comment by fxthomas
Saturday Oct 29, 2016 at 11:40 GMT


Got a working version here : https://travis-ci.org/fxthomas/libresonic (see this commit).

It's still weird for me that Maven can't pick up artifacts from inter-module dependencies automatically without installing, but other than that it appears to work for :

  • Debian packages
  • WAR package
  • Standalone archive
  • Source archive

Things that need progress :

  • I had to add dependencies to ignoredUnusedDeclaredDependencies, not sure why I need this yet but I will find out. The really weren't used, see PR.
  • RPM packages can't be generated on Travis because rpmlint is only available on Xenial. Fixed by cloning the source.
  • Debian packages don't build on Xenial at the moment because lintian is complaining a lot more than on Precise. They build on Jessie and on the maven:latest Docker image, for now this should be fine.
  • Mac packages need a Mac
  • Windows packages need Windows

For the first 3 points it's only a matter of time, but the last two are quite annoying to setup on a CI server.

@issuemover631

This comment has been minimized.

issuemover631 commented Nov 29, 2016

Comment by EugeneKay
Tuesday Nov 29, 2016 at 20:37 GMT


I have decided to put this off until after 6.2, due to the Spring Boot migration. We'll revisit this around 6.3.

@issuemover631

This comment has been minimized.

issuemover631 commented Mar 11, 2017

Comment by trwnh
Saturday Mar 11, 2017 at 05:18 GMT


For what it's worth, having the standalone JAR only would suffice, as it can be run with scripts on any platform. I have always used the JAR from Subsonic for this very reason, as it requires the least dependencies. That would be more useful/important than exe/pkg/deb/rpm.

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 5, 2017

Comment by josh4trunks
Wednesday Apr 05, 2017 at 22:02 GMT


If we get a standalone jar for libresonic, I would gladly submit a port based on www/subsonic-standalone to the FreeBSD ports repository.

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by muff1nman
Thursday Apr 06, 2017 at 00:21 GMT


@josh4trunks The current pre-release artifacts for 6.2 can be used standalone. Its a little counter intuitive because they are war files, but they are also standalone executables.

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by josh4trunks
Thursday Apr 06, 2017 at 04:30 GMT


@muff1nman ohh, awesome. Are the startup flags documented somewhere. Sorry, I'm being lazy asking here.

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by muff1nman
Thursday Apr 06, 2017 at 14:09 GMT


https://github.com/Libresonic/libresonic/blob/develop/documentation/CONFIGURATION.md however that doc isnt really conclusive/complete yet. There are also the parameters to control the initial default music folder, playlist etc that would probably be helpful as a package maintainer. In addition there are some spring boot parameters that can be used as well.

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by josh4trunks
Thursday Apr 06, 2017 at 15:56 GMT


Ok, can I assume the parameters are the same as the subsonic standalone ones?

Here's what we set for FreeBSD for subsonic
https://github.com/freebsd/freebsd-ports/blob/master/www/subsonic-standalone/files/subsonic.in#L76-L85

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by muff1nman
Thursday Apr 06, 2017 at 20:41 GMT


	-Dsubsonic.defaultMusicFolder=${subsonic_home}/music \
	-Dsubsonic.defaultPodcastFolder=${subsonic_home}/Podcast \
	-Dsubsonic.defaultPlaylistFolder=${subsonic_home}/playlists \

Is still relevant, except its now libresonic.X

	-Dsubsonic.host=${subsonic_host} \
	-Dsubsonic.port=${subsonic_port} \

Are no longer controlled directly by libresonic, but can be done via spring boot config:

-Dserver.port=4040
-Dserver.address=127.0.0.1

Here is the full reference on all settings for spring boot. Not all of them will apply, but definitely take a look at the # EMBEDDED SERVER CONFIGURATION section:

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#common-application-properties

@issuemover631

This comment has been minimized.

issuemover631 commented Apr 6, 2017

Comment by josh4trunks
Thursday Apr 06, 2017 at 20:48 GMT


Awesome, that should give me everything I need. I'll try to get this in the FreeBSD ports tree once 6.2 is released.

@issuemover631

This comment has been minimized.

issuemover631 commented May 2, 2017

Comment by EugeneKay
Tuesday May 02, 2017 at 16:33 GMT


This is being considered as a Goal for v6.3 in #373.

@issuemover631

This comment has been minimized.

issuemover631 commented May 18, 2017

Comment by jooola
Thursday May 18, 2017 at 23:11 GMT


@fxthomas Any news on this issue ? Are you still working on this ?

Windows and macOs package are not mandatory right ?

@issuemover631

This comment has been minimized.

issuemover631 commented Jun 1, 2017

Comment by fxthomas
Thursday Jun 01, 2017 at 19:09 GMT


I am not planning on working on this right now (not much time to contribute at the moment unfortunately), so feel free to pick it up! Thanks!

@issuemover631

This comment has been minimized.

issuemover631 commented Jun 26, 2017

Comment by anarcat
Monday Jun 26, 2017 at 12:12 GMT


What's the status here? SpringBoot (#142) seems to be closed, should it be checked off? What's the current .war build infra? Automated?

Is travis hooked up in here?

@issuemover631 issuemover631 added this to the Future milestone Jul 4, 2017

@issuemover631 issuemover631 referenced this issue Jul 4, 2017

Closed

Basic CI setup #133

7 of 7 tasks complete

@jooola jooola removed this from the Future milestone Jul 26, 2017

@joshuaboniface

This comment has been minimized.

joshuaboniface commented Aug 8, 2017

Since we've forked now, I think this is a great idea. The WAR target seem difficult for non-technical users to set up, especially getting into the Tomcat setup.

I'm willing to look into building a Debian package for this, though I can't guarantee any timeline at this point. This is a feature I want for myself anyways. It will probably just wrap the WAR in an archive for now, but if we go back to a native webserver it would be easily extensible to that.

@jooola

This comment has been minimized.

Contributor

jooola commented Aug 9, 2017

@joshuaboniface Why not ask @fxthomas his initial work and finish it ?

I think if you wait the future standalone documentation you will be able to have fully working scripts and service files so you wil only need to pack all those things and Tada !! 🎉

I use standalone war + systemd services + bash scripts + ansible to deploy and it work like a charm for "production use"

@fxthomas

This comment has been minimized.

Contributor

fxthomas commented Aug 9, 2017

I never had time to go over the whole thing and package it correctly.

That being said, I've been using the following service and startup script for a few months without issues (originally from the Subsonic 5.3 package found in the AUR, slightly altered over time). Note the SuccessExitStatus=143 line for that comes from Tomcat usually stopping with that exit code even with a normal stop or restart.

[Unit]
Description=Libresonic
After=network.target

[Service]
User=libresonic
ExecStart=/var/lib/libresonic/libresonic.sh
Type=simple
Restart=on-failure
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

Startup script :

#!/bin/sh

###################################################################################
# Shell script for starting Libresonic.  See http://libresonic.org.
#
# Author: Sindre Mehus
###################################################################################

LIBRESONIC_HOME=/var/lib/libresonic
LIBRESONIC_HOST=127.0.0.1
LIBRESONIC_PORT=4040
LIBRESONIC_HTTPS_PORT=0
LIBRESONIC_CONTEXT_PATH=/libresonic
LIBRESONIC_MAX_MEMORY=400
LIBRESONIC_PIDFILE=
LIBRESONIC_DEFAULT_MUSIC_FOLDER=xxxx
LIBRESONIC_DEFAULT_PODCAST_FOLDER=xxxx
LIBRESONIC_DEFAULT_PLAYLIST_FOLDER=xxxx

quiet=0

usage() {
    echo "Usage: Libresonic.sh [options]"
    echo "  --help               This small usage guide."
    echo "  --home=DIR           The directory where Libresonic will create files."
    echo "                       Make sure it is writable. Default: /var/Libresonic"
    echo "  --host=HOST          The host name or IP address on which to bind Libresonic."
    echo "                       Only relevant if you have multiple network interfaces and want"
    echo "                       to make Libresonic available on only one of them. The default value"
    echo "                       will bind Libresonic to all available network interfaces. Default: 0.0.0.0"
    echo "  --port=PORT          The port on which Libresonic will listen for"
    echo "                       incoming HTTP traffic. Default: 4040"
    echo "  --https-port=PORT    The port on which Libresonic will listen for"
    echo "                       incoming HTTPS traffic. Default: 0 (disabled)"
    echo "  --context-path=PATH  The context path, i.e., the last part of the Libresonic"
    echo "                       URL. Typically '/' or '/Libresonic'. Default '/'"
    echo "  --max-memory=MB      The memory limit (max Java heap size) in megabytes."
    echo "                       Default: 100"
    echo "  --pidfile=PIDFILE    Write PID to this file. Default not created."
    echo "  --quiet              Don't print anything to standard out. Default false."
    echo "  --default-music-folder=DIR    Configure Libresonic to use this folder for music.  This option "
    echo "                                only has effect the first time Libresonic is started. Default '/var/music'"
    echo "  --default-podcast-folder=DIR  Configure Libresonic to use this folder for Podcasts.  This option "
    echo "                                only has effect the first time Libresonic is started. Default '/var/music/Podcast'"
    echo "  --default-playlist-folder=DIR Configure Libresonic to use this folder for playlists.  This option "
    echo "                                only has effect the first time Libresonic is started. Default '/var/playlists'"
    exit 1
}

# Parse arguments.
while [ $# -ge 1 ]; do
    case $1 in
        --help)
            usage
            ;;
        --home=?*)
            LIBRESONIC_HOME=${1#--home=}
            ;;
        --host=?*)
            LIBRESONIC_HOST=${1#--host=}
            ;;
        --port=?*)
            LIBRESONIC_PORT=${1#--port=}
            ;;
        --https-port=?*)
            LIBRESONIC_HTTPS_PORT=${1#--https-port=}
            ;;
        --context-path=?*)
            LIBRESONIC_CONTEXT_PATH=${1#--context-path=}
            ;;
        --max-memory=?*)
            LIBRESONIC_MAX_MEMORY=${1#--max-memory=}
            ;;
        --pidfile=?*)
            LIBRESONIC_PIDFILE=${1#--pidfile=}
            ;;
        --quiet)
            quiet=1
            ;;
        --default-music-folder=?*)
            LIBRESONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
            ;;
        --default-podcast-folder=?*)
            LIBRESONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
            ;;
        --default-playlist-folder=?*)
            LIBRESONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
            ;;
        *)
            usage
            ;;
    esac
    shift
done

# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=java
if [ -e "${JAVA_HOME}" ]
    then
    JAVA=${JAVA_HOME}/bin/java
fi

# Create Libresonic home directory.
mkdir -p ${LIBRESONIC_HOME}
LOG=${LIBRESONIC_HOME}/libresonic_sh.log
rm -f ${LOG}

cd $(dirname $0)
if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
    cd $(dirname $(readlink $0))
fi

exec ${JAVA} -Xmx${LIBRESONIC_MAX_MEMORY}m \
  -Dserver.address=${LIBRESONIC_HOST} \
  -Dserver.contextPath=${LIBRESONIC_CONTEXT_PATH} \
  -Dserver.port=${LIBRESONIC_PORT} \
  -Dlibresonic.port=${LIBRESONIC_PORT} \
  -Dlibresonic.home=${LIBRESONIC_HOME} \
  -Dlibresonic.defaultMusicFolder=${LIBRESONIC_DEFAULT_MUSIC_FOLDER} \
  -Dlibresonic.defaultPodcastFolder=${LIBRESONIC_DEFAULT_PODCAST_FOLDER} \
  -Dlibresonic.defaultPlaylistFolder=${LIBRESONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  -jar libresonic.war

# Additional debug flags you might want to enable :
#  -verbose:gc \
#  -verbose:class \
#  -verbose:jni \
#  -Ddebug -verbose:gc \
#  -Dcom.sun.management.jmxremote.port=51422 \
#  -Dcom.sun.management.jmxremote.authenticate=false
#  -Dcom.sun.management.jmxremote.ssl=false \
#  -agentlib:jdwp=transport=dt_socket,server=y,address=51423,suspend=n
@joshuaboniface

This comment has been minimized.

joshuaboniface commented Aug 9, 2017

I use standalone war + systemd services + bash scripts + ansible to deploy and it work like a charm for "production use"

@jooola I'm doing the same, Ansible to deploy into Tomcat, but I know that's a more advanced configuration that most casual users would want. I'm a big fan of omnibus packages for the casual user.

@fxthomas Thanks for that, it's an excellent starting point. For some reason I thought we removed the built-in webserver during the initial Libresonic work, but I guess not!

@jooola

This comment has been minimized.

Contributor

jooola commented Aug 30, 2017

Closing this since no maintainers proposed there support.
If someone wants to maintain a specific package officially he is free to do so if:

  • You maintain the package in an ongoing basis
  • You support users that needs help to install packages

"The problem we ran into before, is we had a bunch of "supported" packages that weren't really supported by anyone and got to a stale/broken state that looked really bad."

Please open new issue for specific package creation

@jooola jooola closed this Aug 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment