Merge pull request #7 from linuxserver/v4

update to v4, install npm package
This commit is contained in:
aptalca 2020-10-28 19:19:31 -04:00 committed by GitHub
commit 8d12742a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 49 additions and 126 deletions

View File

@ -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 && \

View File

@ -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 && \

View File

@ -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 && \

9
Jenkinsfile vendored
View File

@ -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'
}

View File

@ -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.

View File

@ -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/" }

View File

@ -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." }

View File

@ -1,7 +0,0 @@
{
"mechanism": "plex",
"type": ["server", "user"],
"authorized": [
"AUTH_LIST"
]
}

View File

@ -1,6 +0,0 @@
{
"name": "LSIO Server",
"location": "Self-Hosted",
"url": "SERVERURL/slserver",
"image": "https://avatars3.githubusercontent.com/u/12324908?s=200&v=4"
}

View File

@ -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

View File

@ -1,6 +0,0 @@
#!/usr/bin/with-contenv bash
cd /app/synclounge || exit
exec \
s6-setuidgid abc npm run server

View File

@ -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

View File

@ -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