</div>
<footer class="row">
- <a href="https://joinpeertube.org" title="PeerTube website" target="_blank" rel="noopener noreferrer">PeerTube v{{ serverVersion }}</a> -
+ <a href="https://joinpeertube.org" title="PeerTube website" target="_blank" rel="noopener noreferrer">PeerTube v{{ serverVersion }}{{ serverCommit }}</a> -
<a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" title="PeerTube license" target="_blank" rel="noopener noreferrer">CopyLeft 2015-2018</a>
</footer>
</div>
return this.serverService.getConfig().serverVersion
}
+ get serverCommit () {
+ const commit = this.serverService.getConfig().serverCommit || ''
+ return (commit !== '') ? '...' + commit : commit
+ }
+
get instanceName () {
return this.serverService.getConfig().instance.name
}
import { ClientHtml } from '../../lib/client-html'
import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger'
import { remove, writeJSON } from 'fs-extra'
+import { version } from '../../tools/cli'
const packageJSON = require('../../../../package.json')
const configRouter = express.Router()
asyncMiddleware(deleteCustomConfig)
)
+let serverCommit: string
async function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
const allowed = await isSignupAllowed()
const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip)
+ serverCommit = (serverCommit) ? serverCommit : version()
+ if (serverCommit === packageJSON.version) serverCommit = ''
const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS)
.filter(key => CONFIG.TRANSCODING.ENABLED === CONFIG.TRANSCODING.RESOLUTIONS[key] === true)
}
},
serverVersion: packageJSON.version,
+ serverCommit,
signup: {
allowed,
allowedForCurrentIP,
return sha256(originalName) + '.torrent'
}
+function getVersion () {
+ const tag = require('child_process')
+ .execSync('[[ ! -d .git ]] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', { stdio: [0,1,2] })
+ if (tag) return tag.replace(/^v/, '')
+
+ const version = require('child_process')
+ .execSync('[[ ! -d .git ]] || git rev-parse --short HEAD').toString().trim()
+ if (version) return version
+
+ return require('../../../package.json').version
+}
+
// ---------------------------------------------------------------------------
export {
getFormattedObjects,
getSecureTorrentName,
getServerActor,
+ getVersion,
generateVideoTmpPath
}
const config = require('application-config')('PeerTube/CLI')
const netrc = require('netrc-parser').default
+import { getVersion } from '../helpers/utils'
-const version = () => {
- const tag = require('child_process')
- .execSync('[[ ! -d .git ]] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', { stdio: [0,1,2] })
- if (tag) return tag
-
- const version = require('child_process')
- .execSync('[[ ! -d .git ]] || git rev-parse --short HEAD').toString().trim()
- if (version) return version
-
- return require('../../../package.json').version
-}
+const version = getVersion
let settings = {
remotes: [],
export interface ServerConfig {
serverVersion: string
+ serverCommit?: string
instance: {
name: string