1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00

22 Commits

Author SHA1 Message Date
s2
3d020a3ddd 2.0.3 2020-06-07 20:22:57 +02:00
s2
8765f99f19 update node modules 2020-06-07 20:22:50 +02:00
s2
cee594fcd9 2.0.2 2020-06-07 20:16:05 +02:00
s2
3c4d33eb83 just a note 2020-06-07 20:15:56 +02:00
s2
48b5f33eb9 2.0.1 2020-06-07 20:04:45 +02:00
s2
64b500f414 update node modules 2020-06-07 20:04:45 +02:00
s2
caeaab14b8 remove console.log 2020-06-07 19:50:00 +02:00
s2
94e7c5ce71 don't publish by default in electron builder 2020-06-07 19:48:06 +02:00
s2
cdafb7a006 2.0.0 2020-06-07 19:38:18 +02:00
s2
6c2bc3397e auto update app 2020-06-07 19:37:56 +02:00
s2
a6666452d7 remove update-electron-app 2020-06-07 17:48:58 +02:00
s2
e9feebce51 1.5.2 2020-05-09 15:48:10 +02:00
s2
510e4786b7 create installer package 2020-05-09 15:45:01 +02:00
s2
b540eae1b9 1.5.1 2020-05-09 12:22:28 +02:00
s2
8f3705ba74 show gitlit version in window title 2020-05-09 12:22:21 +02:00
s2
e032eb2ab0 1.5.0 2020-05-09 12:10:34 +02:00
s2
519d719545 auto updater 2020-05-09 12:10:25 +02:00
s2
f8076499ba build windows portable binary 2020-05-09 12:09:23 +02:00
s2
edeadfd7fc 1.4.4 2020-05-06 20:23:03 +02:00
s2
9c26b8fb10 bump exec maxBuffer size to 10MB 2020-05-06 20:22:47 +02:00
s2
b0f3ba27b5 1.4.3 2020-05-06 20:08:09 +02:00
s2
99c858e5a7 update npm modules 2020-05-06 20:08:04 +02:00
7 changed files with 144 additions and 47 deletions

View File

@@ -45,6 +45,9 @@ npm install
npm run dist npm run dist
``` ```
## notes
Since version 2.0.1 the app auto updates itself.
## license ## license
ISC ISC

View File

@@ -49,3 +49,13 @@ table.sortable thead {
table.sortable .sorttable_nosort { table.sortable .sorttable_nosort {
cursor: default; cursor: default;
} }
/*
* updater
*/
.updatenotice {
position: fixed;
bottom: 5px;
right: 5px;
}

View File

@@ -3,7 +3,6 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>gitlit</title>
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script> <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
@@ -21,8 +20,9 @@
<link href="css/app.css" rel="stylesheet"> <link href="css/app.css" rel="stylesheet">
</head> </head>
<body> <body>
<div class="js-container"> <div class="js-container"></div>
</div>
<script src="js/index.js"></script> <script src="js/index.js"></script>
<div class="js-updatenotice btn btn-warning btn-sm updatenotice" style="display:none" disabled>Update ready to install</div>
</body> </body>
</html> </html>

View File

@@ -7,6 +7,35 @@
let firstRun = true; let firstRun = true;
//events //events
//update stuff
ipcRenderer.on('update', (event, state) => {
if (state.event === 'updateAvailable') {
$('.js-updatenotice').text(`New version ${state.version} available. Downloading...`);
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').show();
}
if (state.event === 'updateReadyToInstall') {
$('.js-updatenotice').text(`New version ready to install. Click here to start installer.`);
$('.js-updatenotice').show();
$('.js-updatenotice').prop('disabled', false);
$('.js-updatenotice').data('file', state.file);
}
});
$(document).on('click', '.js-updatenotice', (ev) => {
ev.preventDefault();
if ($('.js-updatenotice').prop('disabled')) {
return;
}
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').text(`Launching installer...`);
ipcRenderer.send('installUpdate', $('.js-updatenotice').data('file'));
});
//end update stuff
ipcRenderer.on('fileList', (event, files) => { ipcRenderer.on('fileList', (event, files) => {
firstRun = false; firstRun = false;
if (files && files.length > 0) { if (files && files.length > 0) {

View File

@@ -3,6 +3,7 @@ const path = require('path');
const url = require('url'); const url = require('url');
const electronLocalshortcut = require('electron-localshortcut'); const electronLocalshortcut = require('electron-localshortcut');
const exec = require('child_process').exec; const exec = require('child_process').exec;
const gau = require('github-app-updater');
const args = require('minimist')(process.defaultApp ? process.argv.slice(3) : process.argv.slice(1), { const args = require('minimist')(process.defaultApp ? process.argv.slice(3) : process.argv.slice(1), {
default: { default: {
_: process.cwd() _: process.cwd()
@@ -13,9 +14,42 @@ let win;
let repoDir = path.resolve(path.normalize(args._.join(' '))); let repoDir = path.resolve(path.normalize(args._.join(' ')));
let repoRootDir = repoDir; let repoRootDir = repoDir;
//auto update stuff
setTimeout(() => {
gau.checkForUpdate({
currentVersion: app.getVersion(),
repo: 'https://api.github.com/repos/S2-/gitlit/releases/latest',
assetMatch: /.+setup.+exe/i
});
gau.onUpdateAvailable = (version, asset) => {
win.webContents.send('update', {
event: 'updateAvailable',
version: version
});
gau.downloadNewVersion(asset);
};
gau.onNewVersionReadyToInstall = (file) => {
win.webContents.send('update', {
event: 'updateReadyToInstall',
file: file
});
};
ipcMain.on('installUpdate', (event, file) => {
gau.executeUpdate(file);
win.webContents.send('update', {
event: 'updateInstalling'
});
});
}, 5000);
//end update stuff
function getLfsFileList(dir, cb) { function getLfsFileList(dir, cb) {
exec('git ls-files | git check-attr --stdin lockable', { exec('git ls-files | git check-attr --stdin lockable', {
maxBuffer: 1024 * 1024, maxBuffer: (1024 * 1024) * 10, //10MB
cwd: dir cwd: dir
}, },
(error, stdout, stderr) => { (error, stdout, stderr) => {
@@ -47,7 +81,7 @@ function getLfsFileList(dir, cb) {
function getLfsLocks(dir, cb) { function getLfsLocks(dir, cb) {
exec('git lfs locks', { exec('git lfs locks', {
maxBuffer: 1024 * 1024, maxBuffer: (1024 * 1024) * 10, //10MB
cwd: dir cwd: dir
}, },
(error, stdout, stderr) => { (error, stdout, stderr) => {
@@ -126,7 +160,7 @@ function loadRepoPage() {
function createWindow() { function createWindow() {
// Create the browser window. // Create the browser window.
win = new BrowserWindow({width: 800, height: 700}); win = new BrowserWindow({title: 'gitlit v' + app.getVersion(), width: 800, height: 700});
win.setMenu(null); win.setMenu(null);
// and load the index.html of the app. // and load the index.html of the app.
@@ -147,7 +181,7 @@ function createWindow() {
function startup(cb) { function startup(cb) {
exec('git rev-parse --show-toplevel', { exec('git rev-parse --show-toplevel', {
maxBuffer: 1024 * 1024, maxBuffer: (1024 * 1024) * 10, //10MB
cwd: repoDir cwd: repoDir
}, },
(error, stdout, stderr) => { (error, stdout, stderr) => {
@@ -170,7 +204,7 @@ function startup(cb) {
ipcMain.on('unlock', (event, file) => { ipcMain.on('unlock', (event, file) => {
exec('git lfs unlock "' + file + '"', { exec('git lfs unlock "' + file + '"', {
maxBuffer: 1024 * 1024, maxBuffer: (1024 * 1024) * 10, //10MB
cwd: repoDir cwd: repoDir
}, },
(error, stdout, stderr) => { (error, stdout, stderr) => {
@@ -193,7 +227,7 @@ ipcMain.on('unlock', (event, file) => {
ipcMain.on('lock', (event, file) => { ipcMain.on('lock', (event, file) => {
exec('git lfs lock --json "' + file + '"', { exec('git lfs lock --json "' + file + '"', {
maxBuffer: 1024 * 1024, maxBuffer: (1024 * 1024) * 10, //10MB
cwd: repoDir cwd: repoDir
}, },
(error, stdout, stderr) => { (error, stdout, stderr) => {

86
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlit", "name": "gitlit",
"version": "1.4.2", "version": "2.0.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -264,9 +264,9 @@
} }
}, },
"bootstrap": { "bootstrap": {
"version": "4.4.1", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz",
"integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA=="
}, },
"boxen": { "boxen": {
"version": "3.2.0", "version": "3.2.0",
@@ -350,6 +350,12 @@
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
"dev": true "dev": true
}, },
"buffer-crc32": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
"dev": true
},
"buffer-fill": { "buffer-fill": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
@@ -1005,15 +1011,15 @@
"dev": true "dev": true
}, },
"extract-zip": { "extract-zip": {
"version": "1.6.7", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
"integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"dev": true, "dev": true,
"requires": { "requires": {
"concat-stream": "1.6.2", "concat-stream": "^1.6.2",
"debug": "2.6.9", "debug": "^2.6.9",
"mkdirp": "0.5.1", "mkdirp": "^0.5.4",
"yauzl": "2.4.1" "yauzl": "^2.10.0"
}, },
"dependencies": { "dependencies": {
"debug": { "debug": {
@@ -1052,9 +1058,9 @@
"dev": true "dev": true
}, },
"fd-slicer": { "fd-slicer": {
"version": "1.0.1", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"dev": true, "dev": true,
"requires": { "requires": {
"pend": "~1.2.0" "pend": "~1.2.0"
@@ -1159,6 +1165,22 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"github-app-updater": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/github-app-updater/-/github-app-updater-1.0.2.tgz",
"integrity": "sha512-bVM4QjTytTLvXjVgzrb7qWApq3SkORFRzksTGI+lhDcliarzStZdu0Im9Git1sdEKiqADO8DEnHfNCua2tiZgQ==",
"requires": {
"node-fetch": "^2.6.0",
"semver": "^7.3.2"
},
"dependencies": {
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
}
}
},
"global-dirs": { "global-dirs": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
@@ -1407,9 +1429,9 @@
"dev": true "dev": true
}, },
"jquery": { "jquery": {
"version": "3.4.1", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
}, },
"js-yaml": { "js-yaml": {
"version": "3.13.1", "version": "3.13.1",
@@ -1652,20 +1674,12 @@
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "^1.2.5"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
} }
}, },
"ms": { "ms": {
@@ -1673,6 +1687,11 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}, },
"node-fetch": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
},
"nonblockjs": { "nonblockjs": {
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/nonblockjs/-/nonblockjs-1.0.8.tgz", "resolved": "https://registry.npmjs.org/nonblockjs/-/nonblockjs-1.0.8.tgz",
@@ -2875,12 +2894,13 @@
} }
}, },
"yauzl": { "yauzl": {
"version": "2.4.1", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"dev": true, "dev": true,
"requires": { "requires": {
"fd-slicer": "~1.0.1" "buffer-crc32": "~0.2.3",
"fd-slicer": "~1.1.0"
} }
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlit", "name": "gitlit",
"version": "1.4.2", "version": "2.0.3",
"description": "", "description": "",
"main": "app/main.js", "main": "app/main.js",
"build": { "build": {
@@ -28,12 +28,13 @@
}, },
"dependencies": { "dependencies": {
"animate.css": "^3.5.2", "animate.css": "^3.5.2",
"bootstrap": "^4.4.1", "bootstrap": "^4.5.0",
"ejs": "^2.7.4", "ejs": "^2.7.4",
"ejs-render-remote": "^1.0.13", "ejs-render-remote": "^1.0.13",
"electron-find": "^1.0.6", "electron-find": "^1.0.6",
"electron-localshortcut": "^3.2.1", "electron-localshortcut": "^3.2.1",
"jquery": "^3.3.1", "github-app-updater": "^1.0.2",
"jquery": "^3.5.1",
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
"minimist": "^1.2.5", "minimist": "^1.2.5",
"nonblockjs": "^1.0.8", "nonblockjs": "^1.0.8",
@@ -46,8 +47,8 @@
}, },
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
"pack": "electron-builder --linux --win --dir", "pack": "electron-builder --linux --win portable nsis --dir --publish=never",
"dist": "electron-builder --linux --win" "dist": "electron-builder --linux --win portable nsis --publish=never"
}, },
"repository": { "repository": {
"type": "git", "type": "git",