diff --git a/Dockerfile b/Dockerfile index d837047..3e11cf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ FROM lsiobase/alpine:3.12 # set version label ARG BUILD_DATE -ARG SYNCLOUNGE_COMMIT +ARG SYNCLOUNGE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="alex-phillips" # environment settings -ENV HOME="/app" WEB_ROOT="/slweb" +ENV HOME="/app" RUN \ echo "**** install build packages ****" && \ @@ -19,17 +19,12 @@ RUN \ git \ jq && \ echo "**** install SyncLounge ****" && \ - if [ -z ${SYNCLOUNGE_COMMIT+x} ]; then \ - SYNCLOUNGE_COMMIT=$(curl -sX GET https://api.github.com/repos/synclounge/synclounge/commits/master \ - | jq -r '. | .sha'); \ + if [ -z ${SYNCLOUNGE_RELEASE+x} ]; then \ + SYNCLOUNGE_RELEASE=$(curl -sX GET "https://registry.npmjs.org/synclounge/" \ + | jq -r '."dist-tags".latest'); \ fi && \ - git clone https://github.com/synclounge/synclounge /app/synclounge && \ - cd /app/synclounge && \ - git checkout ${SYNCLOUNGE_COMMIT} && \ - npm install && \ - npm run build && \ + npm install -g --production synclounge@"$SYNCLOUNGE_RELEASE" && \ npm prune --production && \ - chown -R 911:911 /app/synclounge && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 6a47c41..4518e1e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -2,12 +2,12 @@ FROM lsiobase/alpine:arm64v8-3.12 # set version label ARG BUILD_DATE -ARG SYNCLOUNGE_COMMIT +ARG SYNCLOUNGE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="alex-phillips" # environment settings -ENV HOME="/app" WEB_ROOT="/slweb" +ENV HOME="/app" RUN \ echo "**** install build packages ****" && \ @@ -19,17 +19,12 @@ RUN \ git \ jq && \ echo "**** install SyncLounge ****" && \ - if [ -z ${SYNCLOUNGE_COMMIT+x} ]; then \ - SYNCLOUNGE_COMMIT=$(curl -sX GET https://api.github.com/repos/synclounge/synclounge/commits/master \ - | jq -r '. | .sha'); \ + if [ -z ${SYNCLOUNGE_RELEASE+x} ]; then \ + SYNCLOUNGE_RELEASE=$(curl -sX GET "https://registry.npmjs.org/synclounge/" \ + | jq -r '."dist-tags".latest'); \ fi && \ - git clone https://github.com/synclounge/synclounge /app/synclounge && \ - cd /app/synclounge && \ - git checkout ${SYNCLOUNGE_COMMIT} && \ - npm install && \ - npm run build && \ + npm install -g --production synclounge@"$SYNCLOUNGE_RELEASE" && \ npm prune --production && \ - chown -R 911:911 /app/synclounge && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 30d4a5b..c156ed6 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -2,12 +2,12 @@ FROM lsiobase/alpine:arm32v7-3.12 # set version label ARG BUILD_DATE -ARG SYNCLOUNGE_COMMIT +ARG SYNCLOUNGE_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="alex-phillips" # environment settings -ENV HOME="/app" WEB_ROOT="/slweb" +ENV HOME="/app" RUN \ echo "**** install build packages ****" && \ @@ -19,17 +19,12 @@ RUN \ git \ jq && \ echo "**** install SyncLounge ****" && \ - if [ -z ${SYNCLOUNGE_COMMIT+x} ]; then \ - SYNCLOUNGE_COMMIT=$(curl -sX GET https://api.github.com/repos/synclounge/synclounge/commits/master \ - | jq -r '. | .sha'); \ + if [ -z ${SYNCLOUNGE_RELEASE+x} ]; then \ + SYNCLOUNGE_RELEASE=$(curl -sX GET "https://registry.npmjs.org/synclounge/" \ + | jq -r '."dist-tags".latest'); \ fi && \ - git clone https://github.com/synclounge/synclounge /app/synclounge && \ - cd /app/synclounge && \ - git checkout ${SYNCLOUNGE_COMMIT} && \ - npm install && \ - npm run build && \ + npm install -g --production synclounge@"$SYNCLOUNGE_RELEASE" && \ npm prune --production && \ - chown -R 911:911 /app/synclounge && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Jenkinsfile b/Jenkinsfile index 77cefaa..226ac5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,10 +16,7 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') - EXT_GIT_BRANCH = 'master' - EXT_USER = 'synclounge' - EXT_REPO = 'synclounge' - BUILD_VERSION_ARG = 'SYNCLOUNGE_COMMIT' + BUILD_VERSION_ARG = 'SYNCLOUNGE_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-synclounge' CONTAINER_NAME = 'synclounge' @@ -35,7 +32,7 @@ pipeline { CI_DELAY='120' CI_DOCKERENV='EXTERNAL_URL=0.0.0.0' CI_AUTH='' - CI_WEBPATH='/slweb' + CI_WEBPATH='/' } stages { // Setup all the basic environment variables needed for the build @@ -106,7 +103,7 @@ pipeline { steps{ script{ env.EXT_RELEASE = sh( - script: ''' printf '6aecc9bd' ''', + script: ''' curl -sX GET https://registry.npmjs.org/synclounge/ | jq -r '."dist-tags".latest' ''', returnStdout: true).trim() env.RELEASE_LINK = 'custom_command' } diff --git a/README.md b/README.md index 7180fcb..4d4d09c 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,11 @@ services: container_name: synclounge environment: - TZ=Europe/London - - EXTERNAL_URL=your.domain.com - - EXTERNAL_SERVER_PORT=80 #optional - AUTH_LIST=plexuser1,plexuser2,email1,machineid1 #optional - AUTOJOIN_ENABLED=false #optional - AUTOJOIN_ROOM=roomname #optional - - AUTOJOIN_PASSWORD=password #optional ports: - 8088:8088 - - 8089:8089 restart: unless-stopped ``` @@ -92,14 +88,10 @@ services: docker run -d \ --name=synclounge \ -e TZ=Europe/London \ - -e EXTERNAL_URL=your.domain.com \ - -e EXTERNAL_SERVER_PORT=80 `#optional` \ -e AUTH_LIST=plexuser1,plexuser2,email1,machineid1 `#optional` \ -e AUTOJOIN_ENABLED=false `#optional` \ -e AUTOJOIN_ROOM=roomname `#optional` \ - -e AUTOJOIN_PASSWORD=password `#optional` \ -p 8088:8088 \ - -p 8089:8089 \ --restart unless-stopped \ linuxserver/synclounge ``` @@ -111,15 +103,11 @@ Container images are configured using parameters passed at runtime (such as thos | Parameter | Function | | :----: | --- | -| `-p 8088` | Web app port | -| `-p 8089` | Server port | +| `-p 8088` | Web app and server port | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | -| `-e EXTERNAL_URL=your.domain.com` | The webapp and the server will be accessible at this address via reverse proxy (alternatively, you can define an external IP address). | -| `-e EXTERNAL_SERVER_PORT=80` | If you're not using a reverse proxy, you can define the external port for the server here. | | `-e AUTH_LIST=plexuser1,plexuser2,email1,machineid1` | If set, only the users defined here and the users of the plex servers defined here will be able to access the server. Use e-mails, plex usernames and/or plex server machine ids, comma separated, no spaces. | -| `-e AUTOJOIN_ENABLED=false` | Set to `true` to let users autojoin the server and a room (specified by the `AUTOJOIN_ROOM` var). | -| `-e AUTOJOIN_ROOM=roomname` | Set the room name for auto joining (requires `AUTOJOIN_ENABLED` set to `true`). | -| `-e AUTOJOIN_PASSWORD=password` | Set the password for the room for auto joining (requires `AUTOJOIN_ENABLED` set to `true`). | +| `-e AUTOJOIN_ENABLED=false` | DEPRECATED - (Still works but will be removed in the future in favor of the built-in var `autojoin__room`) - Set to `true` to let users autojoin the server and a room (specified by the `AUTOJOIN_ROOM` var). | +| `-e AUTOJOIN_ROOM=roomname` | DEPRECATED - (Still works but will be removed in the future in favor of the built-in var `autojoin__room`) - Set the room name for auto joining (requires `AUTOJOIN_ENABLED` set to `true`). | ## Environment variables from files (Docker secrets) @@ -142,9 +130,9 @@ Keep in mind umask is not chmod it subtracts from permissions based on it's valu   ## Application Setup -The web app is accessible at `http://SERVERIP:8088`. The server by default is available at `http://SERVERIP:EXTERNAL_SERVER_PORT/slserver`. +The web app and the server are both accessible at `http://SERVERIP:8088`. -Note: The server address is hardcoded to `http` as `https` is not recommended due to not working with external plex clients. When you reverse proxy, use `http` as the external proto for both webapp and server. +Note: It is recommended to use `http` as the external proto with a reverse proxy due to `https` not working with external plex clients. ## Docker Mods @@ -218,6 +206,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **28.10.20:** - Update to v4. Env vars `EXTERNAL_URL`, `EXTERNAL_SERVER_PORT` and `AUTOJOIN_PASSWORD` are deprecated and no longer have any effect. Env vars `AUTOJOIN_ENABLED` and `AUTOJOIN_ROOM` are still working but will be removed in the future in favor of synclounge's built-in var `autojoin__room`. If you are reverse proxying, do not forget to update your proxy settings ([here](https://github.com/linuxserver/reverse-proxy-confs/blob/master/synclounge.subdomain.conf.sample) and [here](https://github.com/linuxserver/reverse-proxy-confs/blob/master/synclounge.subfolder.conf.sample)) as the server port and addresses are changed. * **11.10.20:** - Pin builds to upstream commit `6aecc9bd` while evaluating the breaking changes upstream. * **27.09.20:** - Updating the external repo endpoint. * **01.06.20:** - Rebasing to alpine 3.12. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index cbe7453..018e23d 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -3,15 +3,12 @@ # jenkins variables project_name: docker-synclounge external_type: na -custom_version_command: "printf '6aecc9bd'" +custom_version_command: "curl -sX GET https://registry.npmjs.org/synclounge/ | jq -r '.\"dist-tags\".latest'" release_type: stable release_tag: latest ls_branch: master repo_vars: - - EXT_GIT_BRANCH = 'master' - - EXT_USER = 'synclounge' - - EXT_REPO = 'synclounge' - - BUILD_VERSION_ARG = 'SYNCLOUNGE_COMMIT' + - BUILD_VERSION_ARG = 'SYNCLOUNGE_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-synclounge' - CONTAINER_NAME = 'synclounge' @@ -27,6 +24,6 @@ repo_vars: - CI_DELAY='120' - CI_DOCKERENV='EXTERNAL_URL=0.0.0.0' - CI_AUTH='' - - CI_WEBPATH='/slweb' + - CI_WEBPATH='/' sponsor_links: - { name: "SyncLounge", url: "http://docs.synclounge.tv/contributing/donating/" } diff --git a/readme-vars.yml b/readme-vars.yml index 884ca2e..79b603f 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -20,21 +20,17 @@ param_usage_include_vols: false param_volumes: param_usage_include_ports: true param_ports: - - { external_port: "8088", internal_port: "8088", port_desc: "Web app port" } - - { external_port: "8089", internal_port: "8089", port_desc: "Server port" } + - { external_port: "8088", internal_port: "8088", port_desc: "Web app and server port" } param_usage_include_env: true param_env_vars: - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"} - - { env_var: "EXTERNAL_URL", env_value: "your.domain.com", desc: "The webapp and the server will be accessible at this address via reverse proxy (alternatively, you can define an external IP address)." } # optional container parameters opt_param_usage_include_env: true opt_param_env_vars: - - { env_var: "EXTERNAL_SERVER_PORT", env_value: "80", desc: "If you're not using a reverse proxy, you can define the external port for the server here." } - { env_var: "AUTH_LIST", env_value: "plexuser1,plexuser2,email1,machineid1", desc: "If set, only the users defined here and the users of the plex servers defined here will be able to access the server. Use e-mails, plex usernames and/or plex server machine ids, comma separated, no spaces." } - - { env_var: "AUTOJOIN_ENABLED", env_value: "false", desc: "Set to `true` to let users autojoin the server and a room (specified by the `AUTOJOIN_ROOM` var)." } - - { env_var: "AUTOJOIN_ROOM", env_value: "roomname", desc: "Set the room name for auto joining (requires `AUTOJOIN_ENABLED` set to `true`)." } - - { env_var: "AUTOJOIN_PASSWORD", env_value: "password", desc: "Set the password for the room for auto joining (requires `AUTOJOIN_ENABLED` set to `true`)." } + - { env_var: "AUTOJOIN_ENABLED", env_value: "false", desc: "DEPRECATED - (Still works but will be removed in the future in favor of the built-in var `autojoin__room`) - Set to `true` to let users autojoin the server and a room (specified by the `AUTOJOIN_ROOM` var)." } + - { env_var: "AUTOJOIN_ROOM", env_value: "roomname", desc: "DEPRECATED - (Still works but will be removed in the future in favor of the built-in var `autojoin__room`) - Set the room name for auto joining (requires `AUTOJOIN_ENABLED` set to `true`)." } # optional parameters @@ -44,12 +40,13 @@ optional_block_1_items: "" # application setup block app_setup_block_enabled: true app_setup_block: | - The web app is accessible at `http://SERVERIP:8088`. The server by default is available at `http://SERVERIP:EXTERNAL_SERVER_PORT/slserver`. + The web app and the server are both accessible at `http://SERVERIP:8088`. - Note: The server address is hardcoded to `http` as `https` is not recommended due to not working with external plex clients. When you reverse proxy, use `http` as the external proto for both webapp and server. + Note: It is recommended to use `http` as the external proto with a reverse proxy due to `https` not working with external plex clients. # changelog changelogs: + - { date: "28.10.20:", desc: "Update to v4. Env vars `EXTERNAL_URL`, `EXTERNAL_SERVER_PORT` and `AUTOJOIN_PASSWORD` are deprecated and no longer have any effect. Env vars `AUTOJOIN_ENABLED` and `AUTOJOIN_ROOM` are still working but will be removed in the future in favor of synclounge's built-in var `autojoin__room`. If you are reverse proxying, do not forget to update your proxy settings ([here](https://github.com/linuxserver/reverse-proxy-confs/blob/master/synclounge.subdomain.conf.sample) and [here](https://github.com/linuxserver/reverse-proxy-confs/blob/master/synclounge.subfolder.conf.sample)) as the server port and addresses are changed." } - { date: "11.10.20:", desc: "Pin builds to upstream commit `6aecc9bd` while evaluating the breaking changes upstream." } - { date: "27.09.20:", desc: "Updating the external repo endpoint." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } diff --git a/root/defaults/authentication.json b/root/defaults/authentication.json deleted file mode 100644 index b19c261..0000000 --- a/root/defaults/authentication.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "mechanism": "plex", - "type": ["server", "user"], - "authorized": [ - "AUTH_LIST" - ] -} \ No newline at end of file diff --git a/root/defaults/servers.json b/root/defaults/servers.json deleted file mode 100644 index 75c6c16..0000000 --- a/root/defaults/servers.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "LSIO Server", - "location": "Self-Hosted", - "url": "SERVERURL/slserver", - "image": "https://avatars3.githubusercontent.com/u/12324908?s=200&v=4" -} \ No newline at end of file diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index ea98851..0000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -EXTERNAL_URL=${EXTERNAL_URL:-$(curl icanhazip.com)} -if [ -n "${EXTERNAL_SERVER_PORT}" ]; then - sed -i "s|SERVERURL|http://${EXTERNAL_URL}:${EXTERNAL_SERVER_PORT}|g" /defaults/servers.json -else - sed -i "s|SERVERURL|http://${EXTERNAL_URL}|g" /defaults/servers.json -fi - -if [ -n "${AUTH_LIST}" ]; then - AUTH_LIST=$(echo ${AUTH_LIST} | sed 's|,|",\\n "|g') - sed -i "s|AUTH_LIST|${AUTH_LIST}|g" /defaults/authentication.json -fi - -# permissions -if [ -n "${PUID}" ] && [ "${PUID}" != "911" ]; then - echo "Fixing permissions. FYI, you don't need to set the PUID env var because this app is stateless" - chown -R abc:abc /app -fi \ No newline at end of file diff --git a/root/etc/services.d/server/run b/root/etc/services.d/server/run deleted file mode 100644 index 5b34e0c..0000000 --- a/root/etc/services.d/server/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/with-contenv bash - -cd /app/synclounge || exit - -exec \ - s6-setuidgid abc npm run server diff --git a/root/etc/services.d/synclounge/run b/root/etc/services.d/synclounge/run new file mode 100644 index 0000000..bdaf327 --- /dev/null +++ b/root/etc/services.d/synclounge/run @@ -0,0 +1,13 @@ +#!/usr/bin/with-contenv bash + +if [ "${AUTOJOIN_ENABLED}" == "true" ]; then + export autojoin__room="${AUTOJOIN_ROOM}" +fi +if [ -n "${AUTH_LIST}" ]; then + export authentication__mechanism='["plex"]' + export authentication__type='["server", "user"]' + export authentication__authorized="[\"$(echo ${AUTH_LIST} | sed 's|,|", "|g')\"]" +fi + +exec \ + s6-setuidgid abc synclounge diff --git a/root/etc/services.d/webapp/run b/root/etc/services.d/webapp/run deleted file mode 100644 index 799b33d..0000000 --- a/root/etc/services.d/webapp/run +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/with-contenv bash - -cd /app/synclounge || exit - -export \ - WEB_ACCESSURL="${EXTERNAL_URL:-$(curl icanhazip.com)}/slweb" \ - SERVERS=$(cat /defaults/servers.json) - -if [ "${AUTOJOIN_ENABLED}" == "true" ]; then - export AUTOJOIN_SERVERURL="${EXTERNAL_URL:-$(curl icanhazip.com)}/slserver" -fi -if [ -n "${AUTH_LIST}" ]; then - export AUTHENTICATION=$(cat /defaults/authentication.json) -fi - -exec \ - s6-setuidgid abc node webapp.js