Update all dependencies
This takes part of the work being done in #96 that was reverted but still useful. Note Tailwind and Fresh weren't upgraded because there's no security vulnerability in either, and I have found the new versions to be worse in performance. Thos will likely stay at those fixed versions going forward.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { decodeBase64Url, encodeBase64Url } from 'std/encoding/base64url.ts';
|
||||
import { decodeBase64 } from 'std/encoding/base64.ts';
|
||||
import { Cookie, getCookies, setCookie } from 'std/http/cookie.ts';
|
||||
import 'std/dotenv/load.ts';
|
||||
import { decodeBase64, decodeBase64Url, encodeBase64Url } from '@std/encoding';
|
||||
import { Cookie, getCookies, setCookie } from '@std/http';
|
||||
import '@std/dotenv/load';
|
||||
|
||||
import { generateHash, isRunningLocally } from './utils/misc.ts';
|
||||
import { User, UserSession } from './types.ts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DOMParser, initParser } from 'https://deno.land/x/deno_dom@v0.1.45/deno-dom-wasm-noinit.ts';
|
||||
import { Feed, parseFeed } from 'https://deno.land/x/rss@1.0.0/mod.ts';
|
||||
import { DOMParser, initParser } from '@b-fuze/deno-dom/wasm-noinit';
|
||||
import { Feed, parseFeed } from '@mikaelporttila/rss';
|
||||
import { fetchUrl, fetchUrlAsGooglebot, fetchUrlWithProxy, fetchUrlWithRetries } from './utils/misc.ts';
|
||||
import { NewsFeed, NewsFeedCrawlType, NewsFeedType } from './types.ts';
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ function generateInputHtml(
|
||||
|
||||
if (type === 'select') {
|
||||
return (
|
||||
<select class='mt-1 input-field' id={`field_${name}`} name={name} type={type} {...additionalAttributes}>
|
||||
<select class='mt-1 input-field' id={`field_${name}`} name={name} {...additionalAttributes}>
|
||||
{options?.map((option) => (
|
||||
<option
|
||||
value={option.value}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Client } from 'postgres';
|
||||
import 'std/dotenv/load.ts';
|
||||
import '@std/dotenv/load';
|
||||
|
||||
const POSTGRESQL_HOST = Deno.env.get('POSTGRESQL_HOST') || '';
|
||||
const POSTGRESQL_USER = Deno.env.get('POSTGRESQL_USER') || '';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { createDAVClient } from 'tsdav';
|
||||
|
||||
import { createDAVClient } from '/lib/models/dav.js';
|
||||
import { AppConfig } from '/lib/config.ts';
|
||||
import { getColorAsHex, parseVCalendar } from '/lib/utils/calendar.ts';
|
||||
import { concurrentPromises } from '/lib/utils/misc.ts';
|
||||
@@ -146,7 +145,7 @@ export class CalendarModel {
|
||||
displayName: string,
|
||||
color?: string,
|
||||
): Promise<void> {
|
||||
// Make "manual" request (https://www.rfc-editor.org/rfc/rfc4791.html#page-20) because tsdav doesn't have PROPPATCH
|
||||
// Make "manual" request (https://www.rfc-editor.org/rfc/rfc4791.html#page-20) because the dav client doesn't have PROPPATCH
|
||||
const xmlBody = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<d:proppatch xmlns:d="DAV:" xmlns:a="http://apple.com/ns/ical/">
|
||||
<d:set>
|
||||
@@ -195,15 +194,25 @@ export class CalendarEventModel {
|
||||
},
|
||||
};
|
||||
|
||||
const davCalendarEvents: DAVObject[] = await client.fetchCalendarObjects(fetchOptions);
|
||||
|
||||
if (dateRange) {
|
||||
fetchOptions.timeRange = {
|
||||
start: dateRange.start.toISOString(),
|
||||
end: dateRange.end.toISOString(),
|
||||
};
|
||||
fetchOptions.expand = true;
|
||||
}
|
||||
|
||||
const davCalendarEvents: DAVObject[] = await client.fetchCalendarObjects(fetchOptions);
|
||||
// Sometimes the expand option doesn't return anything, so we we fetch with and without it, when queried for a date range
|
||||
const davCalendarEventsWithExpansion = await client.fetchCalendarObjects(fetchOptions);
|
||||
|
||||
for (const davCalendarEvent of davCalendarEventsWithExpansion) {
|
||||
// Only add the events that are not already in the list
|
||||
if (!davCalendarEvents.some((davCalendarEvent) => davCalendarEvent.url === davCalendarEvent.url)) {
|
||||
davCalendarEvents.push(davCalendarEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const calendarEvents: CalendarEvent[] = [];
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { createDAVClient } from 'tsdav';
|
||||
|
||||
import { createDAVClient } from '/lib/models/dav.js';
|
||||
import { AppConfig } from '/lib/config.ts';
|
||||
import { parseVCard } from '/lib/utils/contacts.ts';
|
||||
|
||||
|
||||
10891
lib/models/dav.js
Normal file
10891
lib/models/dav.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import 'std/dotenv/load.ts';
|
||||
import '@std/dotenv/load';
|
||||
|
||||
import { escapeHtml } from '/lib/utils/misc.ts';
|
||||
import { AppConfig } from '/lib/config.ts';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { join } from 'std/path/join.ts';
|
||||
import { resolve } from 'std/path/resolve.ts';
|
||||
import { join, resolve } from '@std/path';
|
||||
import { lookup } from 'mrmime';
|
||||
import { Cookie, getCookies, setCookie } from 'std/http/cookie.ts';
|
||||
import { Cookie, getCookies, setCookie } from '@std/http';
|
||||
|
||||
import { AppConfig } from '/lib/config.ts';
|
||||
import { Directory, DirectoryFile, FileShare } from '/lib/types.ts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cookie, getCookies, setCookie } from 'std/http/cookie.ts';
|
||||
import { Cookie, getCookies, setCookie } from '@std/http';
|
||||
|
||||
import { MultiFactorAuthMethod, User } from '/lib/types.ts';
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Secret, TOTP } from 'otpauth';
|
||||
import QRCode from 'qrcode';
|
||||
import { encodeBase32 } from 'std/encoding/base32.ts';
|
||||
import { decodeBase64, encodeBase64 } from 'std/encoding/base64.ts';
|
||||
import { qrcode } from '@libs/qrcode';
|
||||
import { decodeBase64, encodeBase32, encodeBase64 } from '@std/encoding';
|
||||
|
||||
import { MultiFactorAuthMethod } from '/lib/types.ts';
|
||||
import { MFA_KEY, MFA_SALT } from '/lib/auth.ts';
|
||||
@@ -133,7 +132,8 @@ export class TOTPModel {
|
||||
private static async generateQRCodeDataURL(secret: string, issuer: string, accountName: string): Promise<string> {
|
||||
const totp = this.createTOTP(secret, issuer, accountName);
|
||||
const uri = totp.toString();
|
||||
return await QRCode.toDataURL(uri);
|
||||
const svgString = await qrcode(uri, { output: 'svg', border: 0 });
|
||||
return `data:image/svg+xml;base64,${encodeBase64(svgString)}`;
|
||||
}
|
||||
|
||||
private static verifyTOTPToken(secret: string, token: string, window = 1): boolean {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Feed } from 'https://deno.land/x/rss@1.0.0/mod.ts';
|
||||
import { Feed } from '@mikaelporttila/rss';
|
||||
|
||||
import Database, { sql } from '/lib/interfaces/database.ts';
|
||||
import Locker from '/lib/interfaces/locker.ts';
|
||||
@@ -136,7 +136,7 @@ export class FeedModel {
|
||||
feedArticle.id;
|
||||
|
||||
// Fix relative URLs in the feeds
|
||||
if (url.startsWith('/')) {
|
||||
if (url!.startsWith('/')) {
|
||||
const feedUrl = new URL(newsFeed.feed_url);
|
||||
url = `${feedUrl.origin}${url}`;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { decodeBase64Url } from 'std/encoding/base64url.ts';
|
||||
import { decodeBase64Url } from '@std/encoding';
|
||||
import * as openIdClient from 'openid-client';
|
||||
import 'std/dotenv/load.ts';
|
||||
import '@std/dotenv/load';
|
||||
|
||||
import { createSessionResponse, dataToText } from '/lib/auth.ts';
|
||||
import { UserModel } from '/lib/models/user.ts';
|
||||
|
||||
@@ -156,7 +156,7 @@ export type OptionalApp = 'news' | 'notes' | 'photos' | 'expenses' | 'contacts'
|
||||
|
||||
export interface Config {
|
||||
auth: {
|
||||
/** The base URL of the application you use to access the app, i.e. "http://localhost:8000" or "https://cloud.example.com" */
|
||||
/** The base URL of the application you use to access the app, i.e. "http://localhost:8000" or "https://cloud.example.com" (note authentication won't work without https:// except for localhost; SSO redirect, if enabled, will be this + /oidc/callback, so "https://cloud.example.com/oidc/callback") */
|
||||
baseUrl: string;
|
||||
/** If true, anyone can sign up for an account. Note that it's always possible to sign up for the first user, and they will be an admin */
|
||||
allowSignups: boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { assertEquals } from 'std/assert/assert_equals.ts';
|
||||
import { assertMatch } from 'std/assert/assert_match.ts';
|
||||
import { assertEquals, assertMatch } from '@std/assert';
|
||||
|
||||
import { Calendar, CalendarEvent } from '/lib/models/calendar.ts';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { assertEquals } from 'std/assert/assert_equals.ts';
|
||||
import { assertMatch } from 'std/assert/assert_match.ts';
|
||||
import { assertEquals, assertMatch } from '@std/assert';
|
||||
|
||||
import { generateVCard, getIdFromVCard, parseVCard, splitTextIntoVCards, updateVCard } from './contacts.ts';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { assertEquals } from 'std/assert/assert_equals.ts';
|
||||
import { assertEquals } from '@std/assert';
|
||||
|
||||
import { humanFileSize } from './files.ts';
|
||||
|
||||
Deno.test('that humanFileSize works', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { assertEquals } from 'std/assert/assert_equals.ts';
|
||||
import { assertEquals } from '@std/assert';
|
||||
|
||||
import { SupportedCurrencySymbol } from '/lib/types.ts';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { join } from 'std/path/join.ts';
|
||||
import { join } from '@std/path';
|
||||
import { lookup } from 'mrmime';
|
||||
|
||||
export function getProperDestinationPath(url: string) {
|
||||
|
||||
Reference in New Issue
Block a user