mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
Improve plugins docker build and fixed plugin loading when dependencies are specified (#6164)
* Install pnpm only local - not global * Install plugins during docker build with live-plugin-manager * Migrated installer to ts. * Added missing workspace script. * Fixed docker build. * Fix Dockerfile * Fixed installer not being yet initialized. * Ported installer to correct install path. * Fixed pnpm installation. * Fixed docker build. * Fixed plugin loading. * Fixed plugins not being able to be loaded. * Fix plugin installation instructions in README * Fixed startup. * Fixed folder not present. * Added unlinking dependencies. * Added deleting dependencies. * Fixed listing plugins. --------- Co-authored-by: SamTV12345 <40429738+samtv12345@users.noreply.github.com>
This commit is contained in:
parent
f9e3416d78
commit
fe106f0afc
16 changed files with 413 additions and 66 deletions
37
bin/installPlugins.ts
Normal file
37
bin/installPlugins.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
import {writeFileSync} from 'fs'
|
||||
import {manager, installedPluginsPath} from "ep_etherpad-lite/static/js/pluginfw/installer";
|
||||
import {PackageData} from "ep_etherpad-lite/node/types/PackageInfo";
|
||||
|
||||
const pluginsModule = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
||||
if (process.argv.length === 2) {
|
||||
console.error('Expected at least one argument!');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const plugins = process.argv.slice(2);
|
||||
|
||||
const persistInstalledPlugins = async () => {
|
||||
const plugins:PackageData[] = []
|
||||
const installedPlugins = {plugins: plugins};
|
||||
for (const pkg of Object.values(await pluginsModule.getPackages()) as PackageData[]) {
|
||||
installedPlugins.plugins.push({
|
||||
name: pkg.name,
|
||||
version: pkg.version,
|
||||
});
|
||||
}
|
||||
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
|
||||
writeFileSync(installedPluginsPath, JSON.stringify(installedPlugins));
|
||||
};
|
||||
|
||||
async function run() {
|
||||
for (const plugin of plugins) {
|
||||
await manager.install(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
await run();
|
||||
await persistInstalledPlugins();
|
||||
})();
|
|
@ -30,7 +30,8 @@
|
|||
"migrateDirtyDBtoRealDB": "node --import tsx migrateDirtyDBtoRealDB.ts",
|
||||
"rebuildPad": "node --import tsx rebuildPad.ts",
|
||||
"stalePlugins": "node --import tsx ./plugins/stalePlugins.ts",
|
||||
"checkPlugins": "node --import tsx ./plugins/checkPlugins.ts"
|
||||
"checkPlugins": "node --import tsx ./plugins/checkPlugins.ts",
|
||||
"install-plugins": "node --import tsx ./installPlugins.ts"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
|
|
|
@ -29,6 +29,14 @@ fi
|
|||
# Prepare the environment
|
||||
bin/installDeps.sh "$@" || exit 1
|
||||
|
||||
## Create the admin ui
|
||||
if [ -z "$NODE_ENV" ] || [ "$NODE_ENV" = "development" ]; then
|
||||
log "Creating the admin UI..."
|
||||
(cd ../admin && pnpm run build)
|
||||
else
|
||||
log "Cannot create the admin UI in production mode"
|
||||
fi
|
||||
|
||||
# Move to the node folder and start
|
||||
log "Starting Etherpad..."
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue