mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-13 08:42:59 -07:00
Disable updates when using Docker container
This commit is contained in:
parent
f572943a7b
commit
8690d2ced5
8 changed files with 104 additions and 76 deletions
4
.github/workflows/publishdocker-branch.yml
vendored
4
.github/workflows/publishdocker-branch.yml
vendored
|
@ -5,6 +5,8 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Get branch
|
||||
run: echo ::set-env name=BRANCH::${GITHUB_REF#refs/heads/}
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
env:
|
||||
|
@ -14,4 +16,4 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
dockerfile: Dockerfile
|
||||
buildargs: VERSION
|
||||
buildargs: VERSION, BRANCH
|
||||
|
|
6
.github/workflows/publishdocker-release.yml
vendored
6
.github/workflows/publishdocker-release.yml
vendored
|
@ -7,7 +7,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Set env
|
||||
- name: Get branch
|
||||
run: echo ::set-env name=BRANCH::${GITHUB_REF#refs/heads/}
|
||||
- name: Get release version
|
||||
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
|
@ -18,5 +20,5 @@ jobs:
|
|||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
dockerfile: Dockerfile
|
||||
buildargs: VERSION
|
||||
buildargs: VERSION, BRANCH
|
||||
tags: ${{ env.RELEASE_VERSION }}
|
||||
|
|
|
@ -3,6 +3,7 @@ FROM python:2.7.17-slim
|
|||
LABEL maintainer="TheMeanCanEHdian"
|
||||
|
||||
ARG VERSION
|
||||
ARG BRANCH
|
||||
|
||||
ENV TAUTULLI_DOCKER=True
|
||||
ENV TZ=UTC
|
||||
|
@ -16,10 +17,10 @@ apt-get install -q -y --no-install-recommends \
|
|||
rm -rf /var/lib/apt/lists/* && \
|
||||
pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
plexapi \
|
||||
pycryptodomex \
|
||||
pyopenssl && \
|
||||
echo ${VERSION} > /app/version.txt
|
||||
echo ${VERSION} > /app/version.txt && \
|
||||
echo ${BRANCH} > /app/branch.txt
|
||||
|
||||
COPY . /app
|
||||
|
||||
|
|
|
@ -43,23 +43,23 @@
|
|||
<div class="container">
|
||||
<div id="ajaxMsg" class="ajaxMsg"></div>
|
||||
% if _session['user_group'] == 'admin':
|
||||
% if plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE is None:
|
||||
% if plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE is not False:
|
||||
<div id="updatebar" style="display: none;">
|
||||
% if plexpy.UPDATE_AVAILABLE is None:
|
||||
You are running an unknown version of Tautulli.<br />
|
||||
<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>
|
||||
</div>
|
||||
% elif plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE == 'release':
|
||||
<div id="updatebar" style="display: none;">
|
||||
% elif plexpy.UPDATE_AVAILABLE == 'release':
|
||||
A <a href="${anon_url('https://github.com/%s/%s/releases/tag/%s' % (plexpy.CONFIG.GIT_USER, plexpy.CONFIG.GIT_REPO, plexpy.LATEST_RELEASE))}" target="_blank">
|
||||
new release (${plexpy.LATEST_RELEASE})</a> of Tautulli is available!<br />
|
||||
<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>
|
||||
</div>
|
||||
% elif plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE == 'commit':
|
||||
<div id="updatebar" style="display: none;">
|
||||
% elif plexpy.UPDATE_AVAILABLE == 'commit':
|
||||
A <a href="${anon_url('https://github.com/%s/%s/compare/%s...%s' % (plexpy.CONFIG.GIT_USER, plexpy.CONFIG.GIT_REPO, plexpy.CURRENT_VERSION, plexpy.LATEST_VERSION))}" target="_blank">
|
||||
newer version</a> of Tautulli is available!<br />
|
||||
You are ${plexpy.COMMITS_BEHIND} commit${'s' if plexpy.COMMITS_BEHIND > 1 else ''} behind.<br />
|
||||
% endif
|
||||
% if plexpy.DOCKER:
|
||||
Update your Docker container or <a href="#" id="updateDismiss">Dismiss</a>
|
||||
% else:
|
||||
<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>
|
||||
% endif
|
||||
</div>
|
||||
% else:
|
||||
<div id="updatebar" style="display: none;"></div>
|
||||
|
@ -318,21 +318,23 @@ ${next.modalIncludes()}
|
|||
complete: function (xhr, status) {
|
||||
var result = $.parseJSON(xhr.responseText);
|
||||
var msg = '';
|
||||
if (result.update === false) {
|
||||
showMsg('<i class="fa fa-check"></i> ' + result.message, false, true, 2000);
|
||||
} else {
|
||||
if (result.update === null) {
|
||||
msg = 'You are running an unknown version of Tautulli.<br />' +
|
||||
'<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>';
|
||||
$('#updatebar').html(msg).fadeIn();
|
||||
msg = 'You are running an unknown version of Tautulli.<br />';
|
||||
} else if (result.update === true && result.release === true) {
|
||||
msg = 'A <a href="' + result.release_url + '" target="_blank">new release (' + result.latest_release + ')</a> of Tautulli is available!<br />' +
|
||||
'<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>';
|
||||
$('#updatebar').html(msg).fadeIn();
|
||||
msg = 'A <a href="' + result.release_url + '" target="_blank">new release (' + result.latest_release + ')</a> of Tautulli is available!<br />';
|
||||
} else if (result.update === true && result.release === false) {
|
||||
msg = 'A <a href="' + result.compare_url + '" target="_blank">newer version</a> of Tautulli is available!<br />' +
|
||||
'You are '+ result.commits_behind + ' commit' + (result.commits_behind > 1 ? 's' : '') + ' behind.<br />' +
|
||||
'<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>';
|
||||
'You are '+ result.commits_behind + ' commit' + (result.commits_behind > 1 ? 's' : '') + ' behind.<br />';
|
||||
}
|
||||
if (result.docker) {
|
||||
msg += 'Update your Docker container or <a href="#" id="updateDismiss">Dismiss</a>';
|
||||
} else {
|
||||
msg += '<a href="update">Update</a> or <a href="#" id="updateDismiss">Dismiss</a>';
|
||||
}
|
||||
$('#updatebar').html(msg).fadeIn();
|
||||
} else if (result.update === false) {
|
||||
showMsg('<i class="fa fa-check"></i> ' + result.message, false, true, 2000);
|
||||
}
|
||||
|
||||
if (_callback) {
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
<div id="git_update_options">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="plexpy_auto_update" name="plexpy_auto_update" value="1" ${config['plexpy_auto_update']}> Update Automatically
|
||||
<input type="checkbox" id="plexpy_auto_update" name="plexpy_auto_update" value="1" ${config['plexpy_auto_update']} ${docker_setting}> Update Automatically ${docker_msg | n}
|
||||
</label>
|
||||
<p class="help-block">Update Tautulli automatically if an update is available.</p>
|
||||
</div>
|
||||
|
|
|
@ -934,3 +934,9 @@ class Config(object):
|
|||
self.GEOIP_DB = os.path.join(plexpy.DATA_DIR, 'GeoLite2-City.mmdb')
|
||||
|
||||
self.CONFIG_VERSION = 14
|
||||
|
||||
if self.CONFIG_VERSION == 14:
|
||||
if plexpy.DOCKER:
|
||||
self.PLEXPY_AUTO_UPDATE = 0
|
||||
|
||||
self.CONFIG_VERSION == 15
|
||||
|
|
|
@ -115,20 +115,24 @@ def getVersion():
|
|||
|
||||
else:
|
||||
|
||||
plexpy.INSTALL_TYPE = 'source'
|
||||
plexpy.INSTALL_TYPE = 'docker' if plexpy.DOCKER else 'source'
|
||||
|
||||
version_file = os.path.join(plexpy.PROG_DIR, 'version.txt')
|
||||
branch_file = os.path.join(plexpy.PROG_DIR, 'branch.txt')
|
||||
|
||||
if not os.path.isfile(version_file):
|
||||
return None, 'origin', common.BRANCH
|
||||
|
||||
if os.path.isfile(version_file):
|
||||
with open(version_file, 'r') as f:
|
||||
current_version = f.read().strip(' \n\r')
|
||||
|
||||
if current_version:
|
||||
return current_version, 'origin', common.BRANCH
|
||||
else:
|
||||
return None, 'origin', common.BRANCH
|
||||
current_version = None
|
||||
|
||||
if os.path.isfile(branch_file):
|
||||
with open(branch_file, 'r') as f:
|
||||
current_branch = f.read().strip(' \n\r')
|
||||
else:
|
||||
current_branch = common.BRANCH
|
||||
|
||||
return current_version, 'origin', current_branch
|
||||
|
||||
|
||||
def check_update(auto_update=False, notify=False):
|
||||
|
@ -232,7 +236,7 @@ def check_github(auto_update=False, notify=False):
|
|||
'plexpy_update_commit': plexpy.LATEST_VERSION,
|
||||
'plexpy_update_behind': plexpy.COMMITS_BEHIND})
|
||||
|
||||
if auto_update:
|
||||
if auto_update and not plexpy.DOCKER:
|
||||
logger.info('Running automatic update.')
|
||||
plexpy.shutdown(restart=True, update=True)
|
||||
|
||||
|
@ -262,6 +266,9 @@ def update():
|
|||
logger.error('Unable to update from git: ' + line)
|
||||
logger.info('Output: ' + str(output))
|
||||
|
||||
elif plexpy.INSTALL_TYPE == 'docker':
|
||||
return
|
||||
|
||||
else:
|
||||
tar_download_url = 'https://github.com/{}/{}/tarball/{}'.format(plexpy.CONFIG.GIT_USER, plexpy.CONFIG.GIT_REPO, plexpy.CONFIG.GIT_BRANCH)
|
||||
update_dir = os.path.join(plexpy.PROG_DIR, 'update')
|
||||
|
|
|
@ -3821,13 +3821,13 @@ class WebInterface(object):
|
|||
versioncheck.check_update()
|
||||
|
||||
if plexpy.UPDATE_AVAILABLE is None:
|
||||
return {'result': 'error',
|
||||
update = {'result': 'error',
|
||||
'update': None,
|
||||
'message': 'You are running an unknown version of Tautulli.'
|
||||
}
|
||||
|
||||
elif plexpy.UPDATE_AVAILABLE == 'release':
|
||||
return {'result': 'success',
|
||||
update = {'result': 'success',
|
||||
'update': True,
|
||||
'release': True,
|
||||
'message': 'A new release (%s) of Tautulli is available.' % plexpy.LATEST_RELEASE,
|
||||
|
@ -3841,7 +3841,7 @@ class WebInterface(object):
|
|||
}
|
||||
|
||||
elif plexpy.UPDATE_AVAILABLE == 'commit':
|
||||
return {'result': 'success',
|
||||
update = {'result': 'success',
|
||||
'update': True,
|
||||
'release': False,
|
||||
'message': 'A newer version of Tautulli is available.',
|
||||
|
@ -3857,11 +3857,16 @@ class WebInterface(object):
|
|||
}
|
||||
|
||||
else:
|
||||
return {'result': 'success',
|
||||
update = {'result': 'success',
|
||||
'update': False,
|
||||
'message': 'Tautulli is up to date.'
|
||||
}
|
||||
|
||||
if plexpy.DOCKER:
|
||||
update['docker'] = plexpy.DOCKER
|
||||
|
||||
return update
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
def do_state_change(self, signal, title, timer, **kwargs):
|
||||
|
@ -3890,6 +3895,9 @@ class WebInterface(object):
|
|||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
def update(self, **kwargs):
|
||||
if plexpy.DOCKER:
|
||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
|
||||
|
||||
# Show changelog after updating
|
||||
plexpy.CONFIG.__setattr__('UPDATE_SHOW_CHANGELOG', 1)
|
||||
plexpy.CONFIG.write()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue