r = new TreeSet<>();
for (Label l : labels.values()) {
@@ -3291,10 +3324,17 @@ public String getLabelString() {
@Override
public void setLabelString(String label) throws IOException {
- this.label = label;
+ _setLabelString(label);
save();
}
+ private void _setLabelString(String label) {
+ this.label = label;
+ if (Jenkins.getInstanceOrNull() != null) { // avoid on unit tests
+ this.labelAtomSet = Collections.unmodifiableSet(Label.parse(label));
+ }
+ }
+
@NonNull
@Override
public LabelAtom getSelfLabel() {
@@ -4540,6 +4580,26 @@ public void doRestart(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
}
}
+ /**
+ * Serve a custom 404 error page, configured in web.xml.
+ */
+ @WebMethod(name = "404")
+ @Restricted(NoExternalUse.class)
+ public void generateNotFoundResponse(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
+ if (ResourceDomainConfiguration.isResourceRequest(req)) {
+ rsp.forward(this, "_404_simple", req);
+ } else {
+ final Object attribute = req.getAttribute(ErrorAttributeFilter.USER_ATTRIBUTE);
+ if (attribute instanceof Authentication) {
+ try (ACLContext unused = ACL.as2((Authentication) attribute)) {
+ rsp.forward(this, "_404", req);
+ }
+ } else {
+ rsp.forward(this, "_404", req);
+ }
+ }
+ }
+
/**
* Queues up a safe restart of Jenkins.
* Builds that cannot continue while the controller is not running have to finish or pause before it can proceed.
@@ -5729,6 +5789,9 @@ public boolean shouldShowStackTrace() {
* See also:{@link #getUnprotectedRootActions}.
*/
private static final Set ALWAYS_READABLE_PATHS = new HashSet<>(Arrays.asList(
+ "404", // Web method
+ "_404", // .jelly
+ "_404_simple", // .jelly
"login", // .jelly
"loginError", // .jelly
"logout", // #doLogout
diff --git a/core/src/main/java/jenkins/security/ResourceDomainFilter.java b/core/src/main/java/jenkins/security/ResourceDomainFilter.java
index eda15fe3e7c9..b88fc7045ff6 100644
--- a/core/src/main/java/jenkins/security/ResourceDomainFilter.java
+++ b/core/src/main/java/jenkins/security/ResourceDomainFilter.java
@@ -25,6 +25,7 @@
package jenkins.security;
import hudson.Extension;
+import hudson.Functions;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
@@ -49,14 +50,14 @@ public class ResourceDomainFilter implements HttpServletFilter {
private static final Logger LOGGER = Logger.getLogger(ResourceDomainFilter.class.getName());
- private static final Set ALLOWED_PATHS = new HashSet<>(Arrays.asList("/" + ResourceDomainRootAction.URL, "/favicon.ico", "/favicon.svg", "/robots.txt"));
+ private static final Set ALLOWED_PATHS = new HashSet<>(Arrays.asList("/" + ResourceDomainRootAction.URL, "/favicon.ico", "/favicon.svg", "/apple-touch-icon.png", "/mask-icon.svg", "/robots.txt", "/images/rage.svg"));
public static final String ERROR_RESPONSE = "Jenkins serves only static files on this domain.";
@Override
public boolean handle(HttpServletRequest req, HttpServletResponse rsp) throws IOException, ServletException {
if (ResourceDomainConfiguration.isResourceRequest(req)) {
String path = req.getPathInfo();
- if (!path.startsWith("/" + ResourceDomainRootAction.URL + "/") && !ALLOWED_PATHS.contains(path)) {
+ if (!path.startsWith("/" + ResourceDomainRootAction.URL + "/") && !ALLOWED_PATHS.contains(path) && !isAllowedPathWithResourcePrefix(path)) {
LOGGER.fine(() -> "Rejecting request to " + req.getRequestURL() + " from " + req.getRemoteAddr() + " on resource domain");
rsp.sendError(404, ERROR_RESPONSE);
return true;
@@ -66,4 +67,7 @@ public boolean handle(HttpServletRequest req, HttpServletResponse rsp) throws IO
return false;
}
+ private static boolean isAllowedPathWithResourcePrefix(String path) {
+ return path.startsWith(Functions.getResourcePath()) && ALLOWED_PATHS.contains(path.substring(Functions.getResourcePath().length()));
+ }
}
diff --git a/core/src/main/java/jenkins/security/ResourceDomainRootAction.java b/core/src/main/java/jenkins/security/ResourceDomainRootAction.java
index a910800ea859..4de14ef1cfcb 100644
--- a/core/src/main/java/jenkins/security/ResourceDomainRootAction.java
+++ b/core/src/main/java/jenkins/security/ResourceDomainRootAction.java
@@ -74,6 +74,8 @@
@Restricted(NoExternalUse.class)
public class ResourceDomainRootAction implements UnprotectedRootAction {
+ private static final String RESOURCE_DOMAIN_ROOT_ACTION_ERROR = "jenkins.security.ResourceDomainRootAction.error";
+
private static final Logger LOGGER = Logger.getLogger(ResourceDomainRootAction.class.getName());
public static final String URL = "static-files";
@@ -104,12 +106,14 @@ public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException
if (ResourceDomainConfiguration.isResourceRequest(req)) {
rsp.sendError(404, ResourceDomainFilter.ERROR_RESPONSE);
} else {
+ req.setAttribute(RESOURCE_DOMAIN_ROOT_ACTION_ERROR, true);
rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL.");
}
}
public Object getDynamic(String id, StaplerRequest req, StaplerResponse rsp) throws Exception {
if (!ResourceDomainConfiguration.isResourceRequest(req)) {
+ req.setAttribute(RESOURCE_DOMAIN_ROOT_ACTION_ERROR, true);
rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL.");
return null;
}
diff --git a/core/src/main/resources/hudson/Messages_fr.properties b/core/src/main/resources/hudson/Messages_fr.properties
index 1c948734def7..543ae2f0dcba 100644
--- a/core/src/main/resources/hudson/Messages_fr.properties
+++ b/core/src/main/resources/hudson/Messages_fr.properties
@@ -49,6 +49,8 @@ Util.day ={0} j
Util.month ={0} mo.
Util.year ={0} an.
+UpdateCenter.DownloadButNotActivated=La mise à jour a été téléchargée avec succès. Elle sera activée lors du prochain démarrage
+
FilePath.TildaDoesntWork=''~'' n''est supporté que sur les shells Unix.
PluginManager.PortNotANumber=Le port n''est pas un nombre
diff --git a/core/src/main/resources/hudson/PluginManager/available.jelly b/core/src/main/resources/hudson/PluginManager/available.jelly
index 212deb493567..b0fa8f8fe5a3 100644
--- a/core/src/main/resources/hudson/PluginManager/available.jelly
+++ b/core/src/main/resources/hudson/PluginManager/available.jelly
@@ -32,8 +32,6 @@ THE SOFTWARE.
-
-
-
-
diff --git a/core/src/main/resources/hudson/PluginManager/sidepanel.jelly b/core/src/main/resources/hudson/PluginManager/sidepanel.jelly
index 5a642c2f5971..0d3fc3fb43d3 100644
--- a/core/src/main/resources/hudson/PluginManager/sidepanel.jelly
+++ b/core/src/main/resources/hudson/PluginManager/sidepanel.jelly
@@ -28,6 +28,7 @@ THE SOFTWARE.
+
diff --git a/core/src/main/resources/hudson/PluginManager/sidepanel_fr.properties b/core/src/main/resources/hudson/PluginManager/sidepanel_fr.properties
new file mode 100644
index 000000000000..c2f09529615c
--- /dev/null
+++ b/core/src/main/resources/hudson/PluginManager/sidepanel_fr.properties
@@ -0,0 +1,27 @@
+# The MIT License
+#
+# Copyright (c) 2023, Damian Szczepanik
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+Updates=Mises à jour
+Available\ plugins=Plugins disponibles
+Installed\ plugins=Plugins installés
+Advanced\ settings=Paramètres avancés
+Download\ progress=Progression des téléchargements
diff --git a/core/src/main/resources/hudson/PluginManager/updates.jelly b/core/src/main/resources/hudson/PluginManager/updates.jelly
index 6bf1982d89fe..25402731273b 100644
--- a/core/src/main/resources/hudson/PluginManager/updates.jelly
+++ b/core/src/main/resources/hudson/PluginManager/updates.jelly
@@ -35,8 +35,6 @@ THE SOFTWARE.
-
-
+
+
+
+
+
+ ${request.session.setAttribute('from', request.getAttribute('javax.servlet.error.request_uri'))}
+
+
+
+
+
+ ${%Oops!}
+
+
+
${%title(javax.servlet.error.message?:'Not Found')}
+
+
+
+
+ ${%noAccess}
+
+
+ ${%notFound}
+
+
+
+
+
+
+
+
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_404.properties b/core/src/main/resources/jenkins/model/Jenkins/_404.properties
new file mode 100644
index 000000000000..c671d3ed833c
--- /dev/null
+++ b/core/src/main/resources/jenkins/model/Jenkins/_404.properties
@@ -0,0 +1,3 @@
+title = {0}
+noAccess = This page may not exist, or you may not have permission to see it.
+notFound = This page does not exist.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_404_simple.jelly b/core/src/main/resources/jenkins/model/Jenkins/_404_simple.jelly
new file mode 100644
index 000000000000..c6a876bb2955
--- /dev/null
+++ b/core/src/main/resources/jenkins/model/Jenkins/_404_simple.jelly
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${%title(javax.servlet.error.message?:'Not Found')}
+
+
+
+
+
+
+
+
+
+ ${%Oops!}
+
+
+
+
+
+
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_404_simple.properties b/core/src/main/resources/jenkins/model/Jenkins/_404_simple.properties
new file mode 100644
index 000000000000..deedf181e429
--- /dev/null
+++ b/core/src/main/resources/jenkins/model/Jenkins/_404_simple.properties
@@ -0,0 +1 @@
+title = {0}
diff --git a/core/src/main/resources/jenkins/model/Messages_tr.properties b/core/src/main/resources/jenkins/model/Messages_tr.properties
index f3108bf971ec..ea0bb121c326 100644
--- a/core/src/main/resources/jenkins/model/Messages_tr.properties
+++ b/core/src/main/resources/jenkins/model/Messages_tr.properties
@@ -33,4 +33,4 @@ Hudson.ViewName=Hepsi
ParameterizedJobMixIn.build_now=Şimdi Yapılandır
BlockedBecauseOfBuildInProgress.shortDescription=Yapılandırma #{0} zaten işlemde {1}
BlockedBecauseOfBuildInProgress.ETA=\ (ETA: {0})
-BuildDiscarderProperty.displayName=Eski Yapılandırmalardan Kurtul
+BuildDiscarderProperty.displayName=Eski yapılandırmalardan kurtul
diff --git a/core/src/main/resources/jenkins/triggers/Messages_tr.properties b/core/src/main/resources/jenkins/triggers/Messages_tr.properties
new file mode 100644
index 000000000000..9f075b4628ae
--- /dev/null
+++ b/core/src/main/resources/jenkins/triggers/Messages_tr.properties
@@ -0,0 +1 @@
+ReverseBuildTrigger.build_after_other_projects_are_built=Başka projeler yapılandırıldıktan sonra yapılandırma tetikle
diff --git a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly
index b524562db973..ce78d10d37e2 100644
--- a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly
+++ b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly
@@ -43,7 +43,7 @@
-
+
diff --git a/core/src/main/resources/lib/hudson/project/config-builders_tr.properties b/core/src/main/resources/lib/hudson/project/config-builders_tr.properties
index 4a9473f35148..0164548aeaba 100644
--- a/core/src/main/resources/lib/hudson/project/config-builders_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/config-builders_tr.properties
@@ -21,4 +21,5 @@
# THE SOFTWARE.
Build=Yapılandırma
+Build\ Steps=Yapılandırma Adımları
Add\ build\ step=Yapılandırma adımı ekle
diff --git a/core/src/main/resources/lib/hudson/project/config-concurrentBuild_tr.properties b/core/src/main/resources/lib/hudson/project/config-concurrentBuild_tr.properties
index 9f65dcded217..8e01433317f8 100644
--- a/core/src/main/resources/lib/hudson/project/config-concurrentBuild_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/config-concurrentBuild_tr.properties
@@ -1,3 +1,3 @@
# This file is under the MIT License by authors
-title.concurrentbuilds=Eğer gerekliyse eş zamanlı yaplandırmaları çalıştır
+title.concurrentbuilds=Gerekirse yaplandırmaları eşzamanlı çalıştır
diff --git a/core/src/main/resources/lib/hudson/project/config-disableBuild_tr.properties b/core/src/main/resources/lib/hudson/project/config-disableBuild_tr.properties
index 7503a2947110..f879e6502115 100644
--- a/core/src/main/resources/lib/hudson/project/config-disableBuild_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/config-disableBuild_tr.properties
@@ -22,3 +22,6 @@
Disable\ this\ project=Yapılandırmayı devre dışı bırak
No\ new\ builds\ will\ be\ executed\ until\ the\ project\ is\ re-enabled.=Proje yeniden devreye alınana kadar yeni yapılandırma çalıştırılmayacaktır.
+Enabled=Etkin
+Disabled=Devre Dışı
+Enable\ or\ disable\ the\ current\ project=Bu projeyi etkinleştir veya devre dışı bırak
diff --git a/core/src/main/resources/lib/hudson/project/config-publishers2_tr.properties b/core/src/main/resources/lib/hudson/project/config-publishers2_tr.properties
index 62d71e587eb2..d674ffa65745 100644
--- a/core/src/main/resources/lib/hudson/project/config-publishers2_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/config-publishers2_tr.properties
@@ -20,4 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Post-build\ Actions=Yapılandırma-sonrası Aksiyonlar
+Post-build\ Actions=Yapılandırma Sonrası Aksiyonlar
+Add\ post-build\ action=Yapılandırma sonrası aksiyonu ekle
diff --git a/core/src/main/resources/lib/hudson/project/config-publishers_tr.properties b/core/src/main/resources/lib/hudson/project/config-publishers_tr.properties
index 62d71e587eb2..0ebb2a0a5cca 100644
--- a/core/src/main/resources/lib/hudson/project/config-publishers_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/config-publishers_tr.properties
@@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Post-build\ Actions=Yapılandırma-sonrası Aksiyonlar
+Post-build\ Actions=Yapılandırma Sonrası Aksiyonlar
diff --git a/core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties b/core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties
index 12685be25f23..f13c9b783140 100644
--- a/core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties
+++ b/core/src/main/resources/lib/hudson/project/makeDisabled_tr.properties
@@ -20,5 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Disable\ Project=Projeyi devre dışı bırak
+Disable\ Project=Projeyi Devre Dışı Bırak
This\ project\ is\ currently\ disabled=Bu proje şimdilik devre dışı
+Enable=Etkinleştir
diff --git a/core/src/main/resources/lib/layout/pane.jelly b/core/src/main/resources/lib/layout/pane.jelly
index 7e10c3d59d71..e7c4a04a8245 100644
--- a/core/src/main/resources/lib/layout/pane.jelly
+++ b/core/src/main/resources/lib/layout/pane.jelly
@@ -52,7 +52,7 @@ THE SOFTWARE.
-