mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 02:09:05 +01:00
Use mixin for drive url
This commit is contained in:
parent
96c8378209
commit
e0f84d1ce6
@ -19,7 +19,7 @@ const ev = new Xev();
|
||||
* Init process
|
||||
*/
|
||||
export default async function () {
|
||||
process.title = `Iceshrimp (${cluster.isPrimary ? "master" : "worker"})`;
|
||||
process.title = `TrashPoss (${cluster.isPrimary ? "master" : "worker"})`;
|
||||
|
||||
if (cluster.isPrimary || envOption.disableClustering) {
|
||||
await masterMain();
|
||||
@ -42,7 +42,7 @@ export default async function () {
|
||||
os.setPriority(10);
|
||||
}
|
||||
|
||||
// For when Iceshrimp is started in a child process during unit testing.
|
||||
// For when TrashPoss is started in a child process during unit testing.
|
||||
// Otherwise, process.send cannot be used, so start it.
|
||||
if (process.send) {
|
||||
process.send("ok");
|
||||
|
@ -34,7 +34,7 @@ function greet() {
|
||||
);
|
||||
}
|
||||
|
||||
bootLogger.info(`Iceshrimp v${meta.version}, initializing...`, null, true);
|
||||
bootLogger.info(`TrashPoss v${meta.version}, initializing...`, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ export async function masterMain() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
bootLogger.succ("Iceshrimp initialized");
|
||||
bootLogger.succ("TrashPoss initialized");
|
||||
|
||||
if (!envOption.disableClustering) {
|
||||
await spawnWorkers(config.clusterLimit);
|
||||
|
@ -81,7 +81,7 @@ export default function load() {
|
||||
mixin.apiUrl = `${mixin.scheme}://${mixin.host}/api`;
|
||||
mixin.authUrl = `${mixin.scheme}://${mixin.host}/auth`;
|
||||
mixin.driveUrl = `${mixin.scheme}://${mixin.host}/files`;
|
||||
mixin.userAgent = `Iceshrimp/${meta.version} (${config.url})`;
|
||||
mixin.userAgent = `TrashPoss/${meta.version} (${config.url})`;
|
||||
mixin.clientEntry = clientManifest["src/init.ts"];
|
||||
mixin.mediaDir = mediaDir ?? `${dir}/files`;
|
||||
|
||||
|
@ -15,13 +15,13 @@ export class InternalStorage {
|
||||
public static saveFromPath(key: string, srcPath: string) {
|
||||
fs.mkdirSync(config.mediaDir, { recursive: true });
|
||||
fs.copyFileSync(srcPath, InternalStorage.resolvePath(key));
|
||||
return `${config.url}/files/${key}`;
|
||||
return `${config.driveUrl}/${key}`;
|
||||
}
|
||||
|
||||
public static saveFromBuffer(key: string, data: Buffer) {
|
||||
fs.mkdirSync(config.mediaDir, { recursive: true });
|
||||
fs.writeFileSync(InternalStorage.resolvePath(key), data);
|
||||
return `${config.url}/files/${key}`;
|
||||
return `${config.driveUrl}/${key}`;
|
||||
}
|
||||
|
||||
public static del(key: string) {
|
||||
|
@ -22,7 +22,7 @@ export const lang = localStorage.getItem("lang");
|
||||
export const langs = _LANGS_;
|
||||
export const locale = JSON.parse(localStorage.getItem("locale"));
|
||||
export const version = _VERSION_;
|
||||
export const instanceName = siteName === "Iceshrimp" ? host : siteName;
|
||||
export const instanceName = siteName === "TrashPoss" ? host : siteName;
|
||||
export let searchEngine = 'https://duckduckgo.com/?q=';
|
||||
export const ui = localStorage.getItem("ui");
|
||||
export const debug = localStorage.getItem("debug") === "true";
|
||||
|
Loading…
Reference in New Issue
Block a user