-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/29.x: #4215 - Ability to specify GID and UID for the user used inside the Docker image #4226 - Display logout button on annotation page if dashboard access is disabled #4215 - Ability to specify GID and UID for the user used inside the Docker image
- Loading branch information
Showing
13 changed files
with
256 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# Licensed to the Technische Universität Darmstadt under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The Technische Universität Darmstadt | ||
# licenses this file to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -x | ||
|
||
# Update the user and group IDs for an existing user | ||
echo "Updating UID [$APP_UID] and GID [$APP_GID] for user [$APP_USER] and group [$APP_GROUP]..." | ||
usermod -u "$APP_UID" "$APP_USER" | ||
groupmod -g "$APP_GID" "$APP_GROUP" | ||
|
||
# Change the ownership of application files | ||
echo "Updating file ownership user inception - this may take a moment..." | ||
chown -R "$APP_USER":"$APP_GROUP" /opt/inception | ||
chown -R "$APP_USER":"$APP_GROUP" /export | ||
|
||
# Run application as the application user | ||
echo "Launching application..." | ||
COMMAND="$(which $1)" | ||
shift | ||
ARGUMENTS="$(printf "\"%s\" " "$@")" | ||
exec su -l -c "${COMMAND} ${ARGUMENTS}" "$APP_USER" |
51 changes: 51 additions & 0 deletions
51
...p/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionActionBarExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.ui.annotation.actionbar.closesession; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.springframework.core.annotation.Order; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.actionbar.ActionBarExtension; | ||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase; | ||
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.config.AnnotationUIAutoConfiguration; | ||
import de.tudarmstadt.ukp.inception.ui.core.menubar.MenuBar; | ||
|
||
/** | ||
* <p> | ||
* This class is exposed as a Spring Component via | ||
* {@link AnnotationUIAutoConfiguration#annotationCloseSessionActionBarExtension}. | ||
* </p> | ||
*/ | ||
@Order(10000) | ||
public class CloseSessionActionBarExtension | ||
implements ActionBarExtension | ||
{ | ||
@Override | ||
public boolean accepts(AnnotationPageBase aPage) | ||
{ | ||
return aPage.visitChildren(MenuBar.class, (c, v) -> { | ||
v.stop(!((MenuBar) c).isVisible()); | ||
}); | ||
} | ||
|
||
@Override | ||
public Panel createActionBarItem(String aId, AnnotationPageBase aPage) | ||
{ | ||
return new CloseSessionPanel(aId, aPage); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...udarmstadt/ukp/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Licensed to the Technische Universität Darmstadt under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The Technische Universität Darmstadt | ||
licenses this file to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
|
||
<body> | ||
<wicket:panel> | ||
<div class="d-flex flex-grow-1"> | ||
<div class="flex-grow-1" /> | ||
<div class="action-bar-group"> | ||
<div class="btn-group"> | ||
<button wicket:id="logoutButton" class="btn btn-action-bar" type="button" wicket:message="title:logOut"> | ||
<div class="text-nowrap"> | ||
<i class="fas fa-sign-out-alt"/> | ||
</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</body> | ||
|
||
</html> |
48 changes: 48 additions & 0 deletions
48
...udarmstadt/ukp/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.ui.annotation.actionbar.closesession; | ||
|
||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.apache.wicket.spring.injection.annot.SpringBean; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase; | ||
import de.tudarmstadt.ukp.clarin.webanno.security.config.LoginProperties; | ||
import de.tudarmstadt.ukp.clarin.webanno.security.config.PreauthenticationProperties; | ||
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink; | ||
import de.tudarmstadt.ukp.clarin.webanno.ui.core.logout.LogoutPanel; | ||
|
||
public class CloseSessionPanel | ||
extends Panel | ||
{ | ||
private static final long serialVersionUID = -9213541738534665790L; | ||
|
||
private @SpringBean PreauthenticationProperties preauthenticationProperties; | ||
private @SpringBean LoginProperties securityProperties; | ||
|
||
public CloseSessionPanel(String aId, AnnotationPageBase aPage) | ||
{ | ||
super(aId); | ||
queue(new LambdaAjaxLink("logoutButton", this::actionLogout)); | ||
} | ||
|
||
private void actionLogout(AjaxRequestTarget aTarget) | ||
{ | ||
LogoutPanel.actionLogout(this, preauthenticationProperties, securityProperties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ redo=Redo | |
moveUp=Up | ||
moveDown=Down | ||
busy=Busy... | ||
logOut=Log out | ||
|
||
enabled=Enabled | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.