0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 05:33:03 -05:00

Merge remote-tracking branch 'origin/main' into dpr-2

This commit is contained in:
fxbrit 2023-08-29 23:34:51 +02:00
commit 8138da9bd5
14 changed files with 309 additions and 63 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "submodules/settings"]
path = submodules/settings
url = https://gitlab.com/librewolf-community/settings.git

View file

@ -0,0 +1,17 @@
{
"name": "codeberg-release-tool",
"version": "0.1.0",
"license": "Apache-2.0",
"scripts": {
"build": "tsc",
"start": "node dist/release.js"
},
"dependencies": {
"axios": "^0.21.1",
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/node": "^20.5.0",
"typescript": "^4.2.4"
}
}

View file

@ -0,0 +1,113 @@
import axios from 'axios';
import fs from 'fs';
import path from 'path';
import FormData from 'form-data';
// Environment Variables:
// CB_API_KEY: The API key for accessing Codeberg.
// TODO: change this to match
const repoUrl = 'https://codeberg.org/api/v1/repos/threadpanic/cb-src-woodpecker';
// Extract the command-line argument and assign to 'version'
const version = process.argv[2];
if (!version) {
console.error('Please provide the version as a command-line argument.');
process.exit(1);
}
const tarball_artifact = `librewolf-${version}.source.tar.gz`;
const sha256sum_artifact = `${tarball_artifact}.sha256sum`;
const tarballExists = fs.existsSync(path.join('..', tarball_artifact));
const sha256sumExists = fs.existsSync(path.join('..', sha256sum_artifact));
if (!tarballExists || !sha256sumExists) {
console.error(`Missing artifacts. Ensure both ${tarball_artifact} and ${sha256sum_artifact} are present in the parent directory.`);
process.exit(1);
}
const apiKey = process.env.CB_API_KEY;
if (!apiKey) {
console.error('API key not found in environment variable CB_API_KEY.');
process.exit(1);
}
const headers = {
'Authorization': `Bearer ${apiKey}`
};
async function addReleaseArtifact(fileName: string, releaseId: number) {
const apiUrl = `${repoUrl}/releases/${releaseId}/assets?name=${fileName}`;
const formData = new FormData();
formData.append('attachment', fs.createReadStream(path.join('..', fileName)));
try {
const response = await axios.post(apiUrl, formData, {
headers: {
...headers,
...formData.getHeaders()
}
});
if (response.status !== 201) {
throw new Error(`Failed to attach artifact ${fileName}. Unexpected response status: ${response.status}`);
}
} catch (error: any) {
console.error(`Error while attaching artifact ${fileName}:`, error.response ? error.response.data : error.message);
throw error;
}
}
async function createNewRelease() {
const releaseUrl = `${repoUrl}/releases`;
const requestBody = {
body: `Release v${version} of the LibreWolf source tarball. Please see the README.md file for compilation instructions and dependency details.`,
draft: false,
name: `Release ${version}`,
prerelease: false,
tag_name: `v${version}`
};
try {
const response = await axios.post(releaseUrl, requestBody, { headers: headers });
if (response.status === 201) {
await addReleaseArtifact(tarball_artifact, response.data.id);
await addReleaseArtifact(sha256sum_artifact, response.data.id);
} else {
throw new Error(`Failed to create release. Unexpected response status: ${response.status}`);
}
} catch (error: any) {
console.error("Error while creating release:", error.response ? error.response.data : error.message);
throw error;
}
}
async function main() {
try {
const releaseListResponse = await axios.get(`${repoUrl}/releases`);
if (releaseListResponse.data.length === 0) {
await createNewRelease();
} else {
const latestReleaseResponse = await axios.get(`${repoUrl}/releases/latest`);
if (latestReleaseResponse.data.tag_name === `v${version}`) {
console.log(`Version v${version} already exists as a release. Exiting without creating a new release.`);
process.exit(0);
}
await createNewRelease();
}
process.exit(0);
} catch (error: any) {
console.error('Error while processing releases:', error);
process.exit(1);
}
}
main();

View file

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist"
},
"include": [
"release.ts"
],
"exclude": [
"node_modules"
]
}

77
.woodpecker.yml Normal file
View file

@ -0,0 +1,77 @@
steps:
fetch:
image: alpine
commands:
- apk update -U
- apk add make gnupg
- make fetch-upstream-woodpecker
test:
image: alpine
commands:
- apk update -U
- apk add make patch
- make check-patchfail-woodpecker
build:
image: alpine
commands:
- apk update -U
- apk add make gnupg patch python3 bash xz
- make all
# my ts+axios api stuff
######
#
# release:
# image: alpine
# when:
# - branch: main
# commands:
# - apk update -U
# - apk add nodejs npm
#
# - ( cd .woodpecker.release && npm install && npm run build )
# - ( cd .woodpecker.release && npm run start $(cat ../version)-$(cat ../release) )
#
# secrets: [ cb_api_key ]
#
# uploading to stortage.ci.librewolf.net
####
#
# upload:
# image: woodpeckerci/plugin-s3
# when:
# - branch: main
# settings:
# bucket: artifacts
# source: "*.{tar.gz,sha256sum}"
# target: /${CI_BUILD_NUMBER}
# path_style: true
# endpoint: https://storage.ci.librewolf.net
#
# secrets: [aws_access_key_id, aws_secret_access_key]
#
# display-links:
# image: alpine
# when:
# - branch: main
# commands:
# - echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz"
# - echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz.sha256sum"
#
#
#

View file

@ -1,6 +1,6 @@
docker_targets=docker-build-image docker-run-build-job docker-remove-image
.PHONY : help check all clean veryclean dir bootstrap fetch build package run update setup-wasi check-patchfail check-fuzz fixfuzz $(docker_targets)
woodpecker_targets=fetch-upstream-woodpecker check-patchfail-woodpecker
.PHONY : help check all clean veryclean dir bootstrap fetch build package run update setup-wasi check-patchfail check-fuzz fixfuzz $(docker_targets) $(woodpecker_targets)
version:=$(shell cat ./version)
release:=$(shell cat ./release)
@ -93,12 +93,15 @@ $(lw_source_dir) : $(ff_source_tarball) ./version ./release scripts/librewolf-pa
$(lw_source_tarball) : $(lw_source_dir)
rm -f $(lw_source_tarball)
$(archive_create) $(lw_source_tarball) $(lw_source_dir)
tar cf librewolf-$(version)-$(release).source.tar $(lw_source_dir)
gzip --fast librewolf-$(version)-$(release).source.tar
touch $(lw_source_dir)
sha256sum $(lw_source_tarball) > $(lw_source_tarball).sha256sum
cat $(lw_source_tarball).sha256sum
sha256sum -c $(lw_source_tarball).sha256sum
[ "$(SIGNING_KEY)" != "" ] && cp -v $(SIGNING_KEY) pk.asc ; true
if [ -f pk.asc ]; then gpg --import pk.asc; gpg --detach-sign $(lw_source_tarball) && ls -lh $(lw_source_tarball).sig; fi
ls -lh $(lw_source_tarball)*
debs=python3 python3-dev python3-pip
@ -124,8 +127,12 @@ package :
run :
(cd $(lw_source_dir) && ./mach run)
check-patchfail:
sh -c "./scripts/check-patchfail.sh" > patchfail.out
check-fuzz:
-sh -c "./scripts/check-patchfail.sh --fuzz=0" > patchfail-fuzz.out
fixfuzz :
@ -158,3 +165,18 @@ setup-debian :
setup-fedora :
dnf -y install python3 curl wget zstd python3-devel python3-pip mercurial openssl-devel libxml2-devel
#
# for .woodpecker.yml
#
check-patchfail-woodpecker :
( sh -c "./scripts/check-patchfail.sh" > patchfail.out ; exit_code=$$? ; \
cat patchfail.out ; rm -f patchfail.out ; exit $$exit_code )
fetch-upstream-woodpecker : fetch

View file

@ -212,7 +212,7 @@
"group": "malware",
"title": "Online Malicious URL Blocklist",
"contentURL": [
"https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-online.txt",
"https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-online.txt",
"assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt"
],
"cdnURLs": [
@ -226,7 +226,7 @@
"content": "filters",
"group": "malware",
"title": "Phishing URL Blocklist",
"contentURL": "https://malware-filter.gitlab.io/malware-filter/phishing-filter.txt",
"contentURL": "https://malware-filter.gitlab.io/phishing-filter/phishing-filter.txt",
"cdnURLs": [
"https://curbengh.github.io/phishing-filter/phishing-filter.txt",
"https://malware-filter.gitlab.io/phishing-filter/phishing-filter.txt",
@ -239,7 +239,7 @@
"group": "malware",
"off": true,
"title": "PUP Domains Blocklist",
"contentURL": "https://malware-filter.gitlab.io/malware-filter/pup-filter.txt",
"contentURL": "https://malware-filter.gitlab.io/pup-filter/pup-filter.txt",
"cdnURLs": [
"https://curbengh.github.io/pup-filter/pup-filter.txt",
"https://malware-filter.gitlab.io/pup-filter/pup-filter.txt",
@ -261,7 +261,7 @@
"adguard-cookies": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"off": true,
"title": "AdGuard Cookie Notices",
"tags": "annoyances cookies",
@ -269,6 +269,22 @@
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
},
"ublock-cookies-adguard": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
"contentURL": "https://ublockorigin.github.io/uAssets/filters/annoyances-cookies.txt",
"cdnURLs": [
"https://ublockorigin.github.io/uAssetsCDN/filters/annoyances-cookies.txt",
"https://ublockorigin.pages.dev/filters/annoyances-cookies.txt",
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/annoyances-cookies.txt",
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/annoyances-cookies.txt"
],
"supportURL": "https://github.com/uBlockOrigin/uAssets"
},
"adguard-popup-overlays": {
"content": "filters",
"group": "annoyances",
@ -357,7 +373,7 @@
"fanboy-cookiemonster": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"off": true,
"title": "EasyList Cookie Notices",
"tags": "annoyances cookies",
@ -374,6 +390,22 @@
],
"supportURL": "https://github.com/easylist/easylist#fanboy-lists"
},
"ublock-cookies-easylist": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
"contentURL": "https://ublockorigin.github.io/uAssets/filters/annoyances-cookies.txt",
"cdnURLs": [
"https://ublockorigin.github.io/uAssetsCDN/filters/annoyances-cookies.txt",
"https://ublockorigin.pages.dev/filters/annoyances-cookies.txt",
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/annoyances-cookies.txt",
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/annoyances-cookies.txt"
],
"supportURL": "https://github.com/uBlockOrigin/uAssets"
},
"easylist-newsletters": {
"content": "filters",
"group": "annoyances",

View file

@ -9,7 +9,7 @@
@@ -29,13 +29,14 @@
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.1" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22621.1555" />
+ <PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>
<Capabilities>

View file

@ -15,13 +15,13 @@ diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
index 23d6bf1..4affc89 100644
--- a/services/settings/Utils.sys.mjs
+++ b/services/settings/Utils.sys.mjs
@@ -62,6 +62,9 @@ XPCOMUtils.defineLazyGetter(lazy, "isRunningTests", () => {
@@ -51,6 +51,9 @@ ChromeUtils.defineLazyGetter(lazy, "isRunningTests", () => {
// Overriding the server URL is normally disabled on Beta and Release channels,
// except under some conditions.
XPCOMUtils.defineLazyGetter(lazy, "allowServerURLOverride", () => {
ChromeUtils.defineLazyGetter(lazy, "allowServerURLOverride", () => {
+
+ return true; // always override in LW
+
+ return true; // always allow this override for LW
+
if (!AppConstants.RELEASE_OR_BETA) {
// Always allow to override the server URL on Nightly/DevEdition.
return true;

View file

@ -1,6 +1,8 @@
diff --git a/uriloader/exthandler/HandlerList.sys.mjs b/uriloader/exthandler/HandlerList.sys.mjs
index e95d627..cd0096e 100644
--- a/uriloader/exthandler/HandlerList.sys.mjs
+++ b/uriloader/exthandler/HandlerList.sys.mjs
@@ -13,228 +13,7 @@ this.kHandlerList = {
@@ -9,196 +9,7 @@ export const kHandlerList = {
schemes: {
mailto: {
handlers: [
@ -28,22 +30,6 @@
- },
- },
- },
- csb: {
- schemes: {
- mailto: {
- handlers: [
- {
- name: "Poczta Interia.pl",
- uriTemplate: "http://poczta.interia.pl/mh/?mailto=%s",
- },
- {
- name: "OnetPoczta",
- uriTemplate: "http://poczta.onet.pl/napisz.html?uri=%s",
- },
- ],
- },
- },
- },
- "es-CL": {
- schemes: {
- mailto: {
@ -181,22 +167,6 @@
- },
- },
- },
- sah: {
- schemes: {
- mailto: {
- handlers: [
- {
- name: "Яндекс.Почта",
- uriTemplate: "https://mail.yandex.ru/compose?mailto=%s",
- },
- {
- name: "Mail.Ru",
- uriTemplate: "https://e.mail.ru/cgi-bin/sentmsg?mailto=%s",
- },
- ],
- },
- },
- },
- uk: {
- schemes: {
- mailto: {

View file

@ -1 +1 @@
2
1

View file

@ -106,18 +106,20 @@ def librewolf_patches():
# we don't want to disturbe those workflows.
patch('../patches/xmas.patch')
#
# Create the 'lw' folder, it contains the librewolf.cfg and policies.json files.
#
#exec('mkdir -p lw')
# getting the librewolf settings repository
exec("cp -v ../submodules/settings/defaults/pref/local-settings.js lw/")
exec("cp -v ../submodules/settings/distribution/policies.json lw/")
exec("cp -v ../submodules/settings/librewolf.cfg lw/")
#
# Apply most recent `settings` repository files.
#
exec('mkdir -p lw')
enter_srcdir('lw')
exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/librewolf.cfg')
exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/distribution/policies.json')
exec('wget -q https://codeberg.org/librewolf/settings/raw/branch/master/defaults/pref/local-settings.js')
leave_srcdir();
# provide a script that fetches and bootstraps Nightly and some mozconfigs
exec('cp -v ../scripts/mozfetch.sh lw/')
exec('cp -v ../assets/mozconfig.new ../assets/mozconfig.new.without-bootstrap ../scripts/setup-wasi-linux.sh lw/')

@ -1 +0,0 @@
Subproject commit ba238a9ca6bfd509f31e6eb4a45c14c11b7ef7fe

View file

@ -1 +1 @@
115.0.2
117.0