Compare commits
4 Commits
9c6539c2ab
...
c0045cf45d
Author | SHA1 | Date |
---|---|---|
|
c0045cf45d | |
|
c0f5f43555 | |
|
cc939f2aae | |
|
068539c85a |
|
@ -0,0 +1,8 @@
|
|||
FROM ubuntu:24.04
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV DEBIAN_PRIORITY=critical
|
||||
|
||||
RUN apt update
|
||||
RUN apt dist-upgrade -y
|
||||
RUN apt install -y build-essential cmake g++ qt6-base-dev qt6-webengine-dev linguist-qt6 libgl1-mesa-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libqt6core5compat6-dev lxqt-build-tools qt6-webengine-dev-tools libqt6webenginecore6-bin
|
||||
|
|
@ -1,11 +1,33 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
agent {
|
||||
docker {
|
||||
image 'ubuntu:24.04'
|
||||
args '-u root:root'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Install Dependencies') {
|
||||
steps {
|
||||
sh '''
|
||||
apt-get update
|
||||
apt-get install -y build-essential cmake g++ qt6-base-dev qt6-webengine-dev linguist-qt6 libgl1-mesa-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libqt6core5compat6-dev lxqt-build-tools qt6-webengine-dev-tools libqt6webenginecore6-bin
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Jenkinsfile for ogbrowser'
|
||||
sh '''
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -G Ninja
|
||||
ninja
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ else()
|
|||
find_package(Qt5LinguistTools "${QT_MINIMUM_VERSION}" REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
||||
find_package(lxqt2-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
||||
|
||||
if(USE_UTF8PROC)
|
||||
find_package(Utf8Proc REQUIRED)
|
||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -53,6 +53,12 @@ int main(int argc, char *argv[])
|
|||
QCommandLineOption disableWebSecurityOption("disable-web-security", "Disable web security and allow custom URL schemes");
|
||||
parser.addOption(disableWebSecurityOption);
|
||||
|
||||
QCommandLineOption noSandboxOption("no-sandbox", "Disable Chromium sandbox to allow running as root");
|
||||
parser.addOption(noSandboxOption);
|
||||
|
||||
QCommandLineOption ignoreSslErrors("ignore-ssl-errors", "Ignore SSL certificate errors");
|
||||
parser.addOption(ignoreSslErrors);
|
||||
|
||||
QCommandLineOption helpOption = parser.addHelpOption();
|
||||
|
||||
OGCommandLineOptions &options = OGCommandLineOptions::getInstance();
|
||||
|
@ -76,6 +82,10 @@ int main(int argc, char *argv[])
|
|||
options.setNewTabBehavior(OGCommandLineOptions::NewTabBehavior::Ignore);
|
||||
}
|
||||
|
||||
if (parser.isSet(ignoreSslErrors)) {
|
||||
options.setIgnoreSslErrors(true);
|
||||
}
|
||||
|
||||
QStringList positional = parser.positionalArguments();
|
||||
if ( positional.length() > 0) {
|
||||
options.setUrl( positional[0 ] );
|
||||
|
|
|
@ -127,6 +127,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
connect(m_web,SIGNAL(loadFinished(bool)),this,SLOT(slotWebLoadFinished(bool)));
|
||||
connect(m_web,SIGNAL(loadProgress(int)),this,SLOT(slotWebLoadProgress(int)));
|
||||
connect(m_web,SIGNAL(urlChanged(const QUrl&)),this,SLOT(slotUrlChanged(const QUrl&)));
|
||||
|
||||
// Ignore SSL errors.
|
||||
|
||||
|
||||
|
@ -180,6 +181,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
//QStringList arguments=QCoreApplication::arguments();
|
||||
|
||||
m_web->setPage( new OGWebPage(this));
|
||||
connect(m_web->page(), &QWebEnginePage::certificateError, this, &MainWindow::slotCertificateErrors);
|
||||
|
||||
|
||||
|
||||
OGCommandLineOptions &options = OGCommandLineOptions::getInstance();
|
||||
QUrl url = QUrl(options.getUrl());
|
||||
|
@ -341,6 +345,18 @@ void MainWindow::slotSslErrors(QNetworkReply* reply)
|
|||
reply->ignoreSslErrors();
|
||||
}
|
||||
|
||||
void MainWindow::slotCertificateErrors(const QWebEngineCertificateError &certificateError) {
|
||||
qWarning() << "SSL error:" << certificateError.description();
|
||||
|
||||
OGCommandLineOptions &options = OGCommandLineOptions::getInstance();
|
||||
if (options.getIgnoreSslErrors()) {
|
||||
qInfo() << "Ignoring SSL errors";
|
||||
|
||||
auto mutableError = const_cast<QWebEngineCertificateError&>(certificateError);
|
||||
mutableError.acceptCertificate();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotProcessStarted()
|
||||
{
|
||||
startProgressBar();
|
||||
|
|
|
@ -58,6 +58,8 @@ class MainWindow : public QMainWindow
|
|||
void slotWebLoadFinished(bool ok);
|
||||
void slotWebLoadProgress(int progress);
|
||||
void slotSslErrors(QNetworkReply* reply);
|
||||
void slotCertificateErrors(const QWebEngineCertificateError &certificateError);
|
||||
|
||||
|
||||
// Funciones que manejan cada vez que el proceso hace algo
|
||||
void slotProcessStarted();
|
||||
|
|
|
@ -35,6 +35,10 @@ class OGCommandLineOptions {
|
|||
NewTabBehavior getNewTabBehavior() const { return _newTabBehavior; }
|
||||
void setNewTabBehavior(NewTabBehavior nt) { _newTabBehavior = nt; }
|
||||
|
||||
bool getIgnoreSslErrors() const { return _ignoreSslErrors; }
|
||||
void setIgnoreSslErrors(bool value) { _ignoreSslErrors = value; }
|
||||
|
||||
|
||||
private:
|
||||
OGCommandLineOptions() {
|
||||
|
||||
|
@ -42,4 +46,6 @@ private:
|
|||
|
||||
QString _url;
|
||||
NewTabBehavior _newTabBehavior{ReplacePage};
|
||||
|
||||
bool _ignoreSslErrors = false;
|
||||
};
|
Loading…
Reference in New Issue