Add etherpad, update codex
This commit is contained in:
parent
176d2a7723
commit
aa2b38d3bf
8 changed files with 206 additions and 14 deletions
|
|
@ -19,19 +19,20 @@
|
|||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "codex";
|
||||
version = "0.104.0";
|
||||
version = "0.107.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "openai";
|
||||
repo = "codex";
|
||||
tag = "rust-v${finalAttrs.version}";
|
||||
#hash = lib.fakeHash;
|
||||
hash = "sha256-spWb/msjl9am7E4UkZfEoH0diFbvAfydJKJQM1N1aoI=";
|
||||
hash = "sha256-FJWEe5uV9jC6vDopmx6XcIcrye2ZwlgpZhWNILXUkHo=";
|
||||
};
|
||||
|
||||
sourceRoot = "${finalAttrs.src.name}/codex-rs";
|
||||
|
||||
cargoHash = "sha256-8XNOqkr03+tI+gqJRR65iWYQ0zsqAiDl2V5bwPoWAcA=";
|
||||
#cargoHash = lib.fakeHash;
|
||||
cargoHash = "sha256-LbKiGMokzHSPsXumhO8PFqqeWb4E2CPa7Xv+FjTZwlE=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
clang
|
||||
|
|
|
|||
51
pkgs/patches/etherpad-declarative-plugin-packages.patch
Normal file
51
pkgs/patches/etherpad-declarative-plugin-packages.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
--- a/src/static/js/pluginfw/plugins.ts
|
||||
+++ b/src/static/js/pluginfw/plugins.ts
|
||||
@@ -123,6 +123,8 @@
|
||||
}));
|
||||
};
|
||||
|
||||
+const declarativePluginDir = path.join(settings.root, 'src', 'plugin_packages');
|
||||
+
|
||||
exports.getPackages = async () => {
|
||||
const {linkInstaller} = require("./installer");
|
||||
const plugins = await linkInstaller.listPlugins();
|
||||
@@ -136,6 +138,39 @@
|
||||
newDependencies[plugin.name] = plugin;
|
||||
}
|
||||
|
||||
+ // Also allow declarative plugins pre-bundled into src/plugin_packages by
|
||||
+ // Nix overlays (without requiring live-plugin-manager runtime state).
|
||||
+ try {
|
||||
+ const entries = await fs.readdir(declarativePluginDir, {withFileTypes: true});
|
||||
+ for (const entry of entries) {
|
||||
+ if (!entry.isDirectory()) continue;
|
||||
+
|
||||
+ const pluginName = entry.name;
|
||||
+ if (!pluginName.startsWith(exports.prefix) || pluginName === 'ep_etherpad-lite') continue;
|
||||
+ if (newDependencies[pluginName]) continue;
|
||||
+
|
||||
+ const pluginPath = path.join(declarativePluginDir, pluginName);
|
||||
+ try {
|
||||
+ const pkg = JSON.parse(await fs.readFile(path.join(pluginPath, 'package.json'), 'utf8'));
|
||||
+ await fs.access(path.join(pluginPath, 'ep.json'));
|
||||
+
|
||||
+ newDependencies[pluginName] = {
|
||||
+ name: pluginName,
|
||||
+ version: pkg.version || '0.0.0',
|
||||
+ path: pluginPath,
|
||||
+ realPath: pluginPath,
|
||||
+ location: pluginPath,
|
||||
+ };
|
||||
+ } catch (err) {
|
||||
+ logger.warn(
|
||||
+ `Skipping declarative plugin ${pluginName}: ${err.message || err.toString()}`,
|
||||
+ );
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (err) {
|
||||
+ // plugin_packages directory is optional in upstream installs.
|
||||
+ }
|
||||
+
|
||||
newDependencies['ep_etherpad-lite'] = {
|
||||
name: 'ep_etherpad-lite',
|
||||
version: getEpVersion(),
|
||||
57
pkgs/patches/etherpad-plugin-index-keys.patch
Normal file
57
pkgs/patches/etherpad-plugin-index-keys.patch
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
diff --git a/src/static/js/pluginfw/installer.ts b/src/static/js/pluginfw/installer.ts
|
||||
index 0fd8949be..22d2d6850 100644
|
||||
--- a/src/static/js/pluginfw/installer.ts
|
||||
+++ b/src/static/js/pluginfw/installer.ts
|
||||
@@ -175,9 +175,17 @@ export const getAvailablePlugins = async (maxCacheAge: number | false) => {
|
||||
return availablePlugins;
|
||||
}
|
||||
|
||||
- const pluginsLoaded: AxiosResponse<MapArrayType<PackageInfo>> = await axios.get(`${settings.updateServer}/plugins.json`, {headers})
|
||||
- availablePlugins = pluginsLoaded.data;
|
||||
+ const pluginsLoaded: AxiosResponse<MapArrayType<PackageInfo>> = await axios.get(`${settings.updateServer}/plugins.json`, {headers});
|
||||
+ const normalizedPlugins: MapArrayType<PackageInfo> = {};
|
||||
+ for (const key in pluginsLoaded.data) {
|
||||
+ const plugin = pluginsLoaded.data[key];
|
||||
+ const normalizedKey = plugin?.name || key;
|
||||
+ normalizedPlugins[normalizedKey] = plugin;
|
||||
+ }
|
||||
+
|
||||
+ availablePlugins = normalizedPlugins;
|
||||
cacheTimestamp = nowTimestamp;
|
||||
+
|
||||
return availablePlugins;
|
||||
};
|
||||
|
||||
@@ -191,22 +199,25 @@ export const search = (searchTerm: string, maxCacheAge: number) => getAvailable
|
||||
}
|
||||
|
||||
for (const pluginName in results) {
|
||||
+ const plugin = results[pluginName];
|
||||
+ const pluginIdentifier = plugin?.name || pluginName;
|
||||
+
|
||||
// for every available plugin
|
||||
// TODO: Also search in keywords here!
|
||||
- if (pluginName.indexOf(plugins.prefix) !== 0) continue;
|
||||
+ if (pluginIdentifier.indexOf(plugins.prefix) !== 0) continue;
|
||||
|
||||
- if (searchTerm && !~results[pluginName].name.toLowerCase().indexOf(searchTerm) &&
|
||||
- (typeof results[pluginName].description !== 'undefined' &&
|
||||
- !~results[pluginName].description.toLowerCase().indexOf(searchTerm))
|
||||
+ if (searchTerm && !~plugin.name.toLowerCase().indexOf(searchTerm) &&
|
||||
+ (typeof plugin.description !== 'undefined' &&
|
||||
+ !~plugin.description.toLowerCase().indexOf(searchTerm))
|
||||
) {
|
||||
- if (typeof results[pluginName].description === 'undefined') {
|
||||
- logger.debug(`plugin without Description: ${results[pluginName].name}`);
|
||||
+ if (typeof plugin.description === 'undefined') {
|
||||
+ logger.debug(`plugin without Description: ${plugin.name}`);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
- res[pluginName] = results[pluginName];
|
||||
+ res[pluginIdentifier] = plugin;
|
||||
}
|
||||
|
||||
return res;
|
||||
11
pkgs/patches/etherpad-plugin-package-bootstrap-path.patch
Normal file
11
pkgs/patches/etherpad-plugin-package-bootstrap-path.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- a/src/templates/padBootstrap.js
|
||||
+++ b/src/templates/padBootstrap.js
|
||||
@@ -31,7 +31,7 @@
|
||||
window.plugins.baseURL = basePath;
|
||||
await window.plugins.update(new Map([
|
||||
<% for (const module of pluginModules) { %>
|
||||
- [<%- JSON.stringify(module) %>, require("../../src/plugin_packages/"+<%- JSON.stringify(module) %>)],
|
||||
+ [<%- JSON.stringify(module) %>, require("./src/plugin_packages/"+<%- JSON.stringify(module) %>)],
|
||||
<% } %>
|
||||
]));
|
||||
// Mechanism for tests to register hook functions (install fake plugins).
|
||||
Loading…
Add table
Add a link
Reference in a new issue