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

52 Commits

Author SHA1 Message Date
dependabot[bot]
0fa715247d Bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-03 04:54:17 +00:00
s2
44b4183597 2.0.16 2021-06-19 00:44:18 +02:00
s2
cfce0edaa9 update node modules 2021-06-19 00:43:58 +02:00
s2
5edd143318 2.0.15 2021-05-07 15:54:10 +02:00
s2
e576161518 update node modules 2021-05-07 15:53:54 +02:00
s2
7a63056ef3 2.0.14 2021-01-29 09:43:45 +01:00
s2
efd9d13454 update node modules 2021-01-29 09:43:28 +01:00
s2
9836f5c918 2.0.13 2021-01-13 15:57:32 +01:00
s2
6c9787fea1 add homepage link 2021-01-13 15:57:21 +01:00
s2
16138409f9 2.0.12 2020-12-11 12:34:12 +01:00
s2
f604749ce8 update electron 2020-12-11 12:33:55 +01:00
s2
a259bd3e14 2.0.11 2020-10-16 12:01:12 +02:00
s2
e3ed1c6e44 update node modules 2020-10-16 12:00:49 +02:00
s2
5d60c8baac 2.0.10 2020-09-13 12:53:00 +02:00
s2
8afc7fdac1 update node modules 2020-09-13 12:52:30 +02:00
s2
e934617a03 ask if the update should be downloaded 2020-09-13 12:52:22 +02:00
s2
9f696e12f9 2.0.9 2020-09-13 10:24:36 +02:00
s2
b326c45593 update node modules 2020-09-13 10:24:23 +02:00
s2
c905040f0e 2.0.8 2020-07-21 14:29:51 +02:00
s2
a171760bd6 update npm modules 2020-07-21 14:29:38 +02:00
s2
ce50a38e35 2.0.7 2020-07-07 11:50:30 +02:00
s2
133f72df2a fix updater 2020-07-07 11:50:21 +02:00
s2
bebaf95f70 2.0.6 2020-07-07 10:42:56 +02:00
s2
e719261427 update to latest electron version 2020-07-07 10:40:27 +02:00
s2
1fe4d0d90c 2.0.5 2020-06-07 22:43:44 +02:00
s2
9873246826 auto update only on windows 2020-06-07 22:43:33 +02:00
s2
b8a94f650f 2.0.4 2020-06-07 22:17:29 +02:00
s2
e97a5c1fc2 just readme 2020-06-07 22:17:26 +02:00
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
s2
9f02f5f27c 1.4.2 2020-03-16 21:46:57 +01:00
s2
48ecb505d7 update node modules 2020-03-16 21:46:15 +01:00
9 changed files with 1898 additions and 1843 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 using the [github-app-updater](https://www.npmjs.com/package/github-app-updater).
## 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

@@ -2,11 +2,53 @@
const ipcRenderer = require('electron').ipcRenderer; const ipcRenderer = require('electron').ipcRenderer;
const remote = require('electron').remote; const remote = require('electron').remote;
const electronFind = require('electron-find'); const electronFind = require('electron-find');
const dialog = remote.require('electron').dialog;
const shell = require('electron').shell;
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents()); let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
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. Click here to download.`);
$('.js-updatenotice').show();
$('.js-updatenotice').prop('disabled', false);
$('.js-updatenotice').prop('state', 'ready-to-download');
$('.js-updatenotice').data('asset', state.asset);
}
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').prop('state', 'ready-to-install');
$('.js-updatenotice').data('file', state.file);
}
});
$(document).on('click', '.js-updatenotice', (ev) => {
ev.preventDefault();
if ($('.js-updatenotice').prop('disabled')) {
return;
}
if ($('.js-updatenotice').prop('state') === 'ready-to-download') {
$('.js-updatenotice').prop('disabled', true);
$('.js-updatenotice').text(`Downloading new version...`);
ipcRenderer.send('downloadUpdate', $('.js-updatenotice').data('asset'));
} else if ($('.js-updatenotice').prop('state') === 'ready-to-install') {
$('.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) {
@@ -92,12 +134,20 @@
$(document).on('click', '.js-open-folder', (ev) => { $(document).on('click', '.js-open-folder', (ev) => {
ev.preventDefault(); ev.preventDefault();
$('.js-open-folder-input').trigger('click');
dialog.showOpenDialog({
properties: ['openDirectory']
})
.then((path) => {
if (path && path.filePaths.length > 0) {
ipcRenderer.send('restart', path.filePaths[0]);
};
});
}); });
$(document).on('change', '.js-open-folder-input', (ev) => { $(document).on('click', 'a[href^="http"]', function(event) {
ev.preventDefault(); event.preventDefault();
ipcRenderer.send('restart', $('.js-open-folder-input')[0].files[0].path); shell.openExternal(this.href);
}); });
$(document).on('keypress', (ev) => { $(document).on('keypress', (ev) => {

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,49 @@ 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
if (process.platform === 'win32') {
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,
asset: asset
});
};
gau.onNewVersionReadyToInstall = (file) => {
win.webContents.send('update', {
event: 'updateReadyToInstall',
file: file
});
};
ipcMain.on('downloadUpdate', (event, asset) => {
gau.downloadNewVersion(asset);
});
ipcMain.on('installUpdate', (event, file) => {
gau.executeUpdate(file);
win.webContents.send('update', {
event: 'updateInstalling'
});
app.quit();
});
}, 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 +88,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 +167,15 @@ 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,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true
}
});
win.setMenu(null); win.setMenu(null);
// and load the index.html of the app. // and load the index.html of the app.
@@ -147,7 +196,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 +219,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 +242,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) => {
@@ -223,9 +272,3 @@ ipcMain.on('restart', (event, newRepoDir) => {
app.on('ready', () => { app.on('ready', () => {
startup(createWindow); startup(createWindow);
}); });
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});

View File

@@ -6,4 +6,7 @@
<a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a> <a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a>
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory /> <input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
</div> </div>
<p>
<a href="https://github.com/S2-/gitlit">Homepage</a>
</p>
</div> </div>

View File

@@ -1,4 +1,3 @@
<div class="text-center"> <div class="text-center">
<a class="btn btn-primary js-open-folder" href="javascript:///">Open another folder</a> <a class="btn btn-primary js-open-folder" href="javascript:///">Open another folder</a>
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
</div> </div>

3564
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlit", "name": "gitlit",
"version": "1.4.1", "version": "2.0.16",
"description": "", "description": "",
"main": "app/main.js", "main": "app/main.js",
"build": { "build": {
@@ -27,27 +27,28 @@
} }
}, },
"dependencies": { "dependencies": {
"animate.css": "^3.5.2", "animate.css": "^4.1.1",
"bootstrap": "^4.1.3", "bootstrap": "^4.6.0",
"ejs": "^2.6.1", "ejs": "^3.1.6",
"ejs-render-remote": "^1.0.7", "ejs-render-remote": "^1.0.13",
"electron-find": "^1.0.6", "electron-find": "^1.0.6",
"electron-localshortcut": "^3.1.0", "electron-localshortcut": "^3.2.1",
"jquery": "^3.3.1", "github-app-updater": "^1.0.5",
"jquery": "^3.6.0",
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
"minimist": "^1.2.0", "minimist": "^1.2.5",
"nonblockjs": "^1.0.8", "nonblockjs": "^1.0.8",
"pnotify": "^4.0.0-alpha.4", "pnotify": "^4.0.1",
"popper.js": "^1.14.3" "popper.js": "^1.16.1"
}, },
"devDependencies": { "devDependencies": {
"electron": "^3.0.3", "electron": "^13.1.2",
"electron-builder": "^20.43.0" "electron-builder": "^22.11.7"
}, },
"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",