'no identity found' when using gradle to exec codesign - java

I am trying to sign my Java/JavaFX application using codesign with gradle. My gradle code is as following:
exec {
val codeSignArgs = listOf("-s", "'${macSigningKeyDeveloperIdApp}'", "--timestamp", "--options", "runtime", "--entitlements", "../../../entitlements.plist", "--deep", "-f", "--verbose", "UTMCoordinateConverter.app")
logger.quiet("code sign args: $codeSignArgs")
workingDir = macRel
isIgnoreExitValue = true
executable = codeSignTool.absolutePath
args(codeSignArgs)
}
Where codeSignTool is /usr/bin/codesign and macRel is the directory where the app file is, and macSigningKeyDeveloperIdApp is my signing developer id.
Gradle gives me the following output:
> Task :codeSign
Inside codeSign
code sign args: [-s, 'Developer ID Application: Victor Ewert (XXXXXXXXXX)', --timestamp, --options, runtime, --entitlements, ../../../entitlements.plist, --deep, -f, --verbose, UTMCoordinateConverter.app]
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
'Developer ID Application: Victor Ewert (XXXXXXXXXX)': no identity found
2:38:26 p.m.: Task execution finished 'codeSign'.
The strange thing is, I can run the (equivalent) command fine, from the command line using:
/usr/bin/codesign -s 'Developer ID Application: Victor Ewert (XXXXXXXXX)' --timestamp --options runtime --entitlements ../../../entitlements.plist --deep -f --verbose UTMCoordinateConverter.app
run from the location of the app file.
I have double and triple checked my Developer ID, and it looks fine (checked using security find-identity -p codesigning -v login.keychain. I have also made sure my login keychain is unlocked. I don't think it is a problem with my Developer ID.
I'm guessing it has something to do with how gradle is executing the command, but I can't figure it out.

Related

Cannot start service www: driver failed programming external connectivity on endpoint

I converted this original project into a docker-compose project here and followed a their setup instructions. It seems that I am not able to connect with the browser.
The SQL file contains the database schema and looks like this:
CREATE DATABASE mgsv;
CREATE USER 'mgsv_user'#'localhost' IDENTIFIED BY 'mgsvpass';
GRANT SELECT, INSERT, CREATE, DROP ON mgsv.* TO 'mgsvuser'#'localhost';
use mgsv;
CREATE TABLE IF NOT EXISTS `userinfo` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`email` text NOT NULL,
`hash` text NOT NULL,
`synfilename` text NOT NULL,
`annfilename` text NOT NULL,
`url` text NOT NULL,
`session_id` text NOT NULL,
`annImage` int(5) NOT NULL,
`create_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
The docker-compose.yml looks like this:
version: '3.1'
services:
db:
image: mysql
restart: always
environment:
- MYSQL_DATABASE=mgsv
- MYSQL_USER=mgsv_user
- MYSQL_PASSWORD=mgsvpass
- MYSQL_ROOT_PASSWORD=mysql123
volumes:
- ./mysql:/docker-entrypoint-initdb.d
www:
build: ./mGSV
restart: always
ports:
- 8080:8080
And the Dockerfile contains PHP and all other tools setup and looks like this.
FROM php:5-apache
RUN apt-get update && apt-get install -y --no-install-recommends \
openjdk-7-jdk \
maven \
git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/qunfengdong/mGSV.git
# Move the folder 'mgsv' to DocumentRoot of Apache web server. By default, the DocumentRoot of Apache is /var/www/ (speak to the system administrator to know the exact DocumentRoot).
RUN cd /var/www/html/mGSV \
&& mkdir tmp \
&& chmod -R 777 tmp
RUN cd /var/www/html/mGSV && sed -i.bak "s|'gsv'|'mgsv_user'|" lib/settings.php \
&& sed -i.bak "s|$database_pass = ''|$database_pass = 'mgsvpass'|" lib/settings.php \
&& sed -i.bak "s|cas-qshare.cas.unt.edu|localhost|" lib/settings.php
RUN cp /var/www/html/mGSV/Arial.ttf /usr/share/fonts/truetype/
#Do not understand
#7. Cleanup scripts are provided to drop database synteny and annotation tables, remove entries from database table 'userinfo' and delete the folder containing image files which are older than 60 days. This task is accomplished by cron job to run the cleanup script every day. To create a cron job, use the command below:
# shell> crontab -e
#At the last line of crontab, copy and paste the line below, and provide the exact path to mgsv/lib/cleanup.php
# 30 04 * * * /var/www/mgsv/lib/cleanup.php
#The script cleanup.php will be executed at 4:30 AM every morning.
#8. mGSV uses the mail function from PHP to send email to users. Speak to your system administrator to provide required information in the PHP configuration file called 'php.ini'.
#9. When installation completes, you can now open Install/index.php (i.e., http://<YOUR_SERVER_DOMAIN_NAME>/mgsv/Install/), which verifies prerequisites, database setup, and installation. YOUR_SERVER_DOMAIN_NAME refers to the domain name of your server.
RUN cd /var/www/html/mGSV/ws \
&& tar -xzf mgsv-ws-server.tar.gz
RUN cd /var/www/html/mGSV/ws/mgsv-ws-server \
&& mvn package
RUN cp -f /var/www/html/mGSV/ws/mgsv-ws-server/target/ws-server-1.0RC1-jar-with-dependencies.jar /var/www/html/mGSV/ws/
RUN cd /var/www/html/mGSV/ws \
&& echo "mgsv_upload_url=http://localhost/mgsv" > config.properties \
&& echo "ws_publish_url=http\://localhost\:8081/MGSVService" >> config.properties \
&& java -jar ws-server-1.0RC1-jar-with-dependencies.jar &
#To stop the web service
#shell> ps aux | grep ws-server-1.0RC1-jar-with-dependencies.jar
#*Note the process id from the output*
#shell> kill -9 <process id>
This is the output which I got:
Successfully tagged mgsvdocker_www:latest
Starting mgsvdocker_www_1 ...
mgsvdocker_db_1 is up-to-date
Starting mgsvdocker_www_1 ... error
ERROR: for mgsvdocker_www_1 Cannot start service www: driver failed programming external connectivity on endpoint mgsvdocker_www_1 (37d78703b379b65521d9fc15d2d1d51379f7eee71f7dc912585e088d8bf1b4e9): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: for www Cannot start service www: driver failed programming external connectivity on endpoint mgsvdocker_www_1 (37d78703b379b65521d9fc15d2d1d51379f7eee71f7dc912585e088d8bf1b4e9): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.
I am not quite sure whether I did a mistake in the docker-compose.yml file or database configuration inside the Dockerfile.
By any chance, do anyone know what I am missing?
Thank you in advance

How to add module to Wildfly using CLI

I'm trying to create a Wildfly docker image with a postgres datasource.
When I build the dockerfile it always fails with Permission Denied when I try to install the postgres module.
My dockerfile looks look this:
FROM wildflyext/wildfly-camel
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin --silent
ADD postgresql-9.4-1201.jdbc41.jar /tmp/
ADD config.sh /tmp/
ADD batch.cli /tmp/
RUN /tmp/config.sh
Which calls the following:
#!/bin/bash
JBOSS_HOME=/opt/jboss/wildfly
JBOSS_CLI=$JBOSS_HOME/bin/jboss-cli.sh
JBOSS_MODE=${1:-"standalone"}
JBOSS_CONFIG=${2:-"$JBOSS_MODE.xml"}
function wait_for_wildfly() {
until `$JBOSS_CLI -c "ls /deployment" &> /dev/null`; do
sleep 10
done
}
echo "==> Starting WildFly..."
$JBOSS_HOME/bin/$JBOSS_MODE.sh -c $JBOSS_CONFIG > /dev/null &
echo "==> Waiting..."
wait_for_wildfly
echo "==> Executing..."
$JBOSS_CLI -c --file=`dirname "$0"`/batch.cli --connect
echo "==> Shutting down WildFly..."
if [ "$JBOSS_MODE" = "standalone" ]; then
$JBOSS_CLI -c ":shutdown"
else
$JBOSS_CLI -c "/host=*:shutdown"
fi
And
batch
module add --name=org.postgresql --resources=/tmp/postgresql-9.4-1201.jdbc41.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)
run-batch
The output when building is:
==> Starting WildFly...
==> Waiting...
==> Executing... Failed to locate the file on the filesystem copying /tmp/postgresql-9.4-1201.jdbc41.jar to
/opt/jboss/wildfly/modules/org/postgresql/main/postgresql-9.4-1201.jdbc41.jar:
/tmp/postgresql-9.4-1201.jdbc41.jar (Permission denied)
What permissions are required, and where do I set the permission(s)?
Thanks
It seems the JAR file is not readable by the jboss user (the user comming from parent image). The postgresql-9.4-1201.jdbc41.jar is added under the root user - find details in this GitHub discussion.
You could
either add permissions to JAR file before adding it to the image
or add permissions to JAR file in the image after the adding
or change ownership of the file in the image
The simplest solution could be the first one. The other 2 solutions need also switching user to root (USER root in dockerfile) and then back to jboss.
Here a advice : make a cli file like this :
connect
module add --name=sqlserver.jdbc --resources=#INSTALL_FOLDER#/libext/jtds-1.3.1.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=sqlserver:add(driver-module-name=sqlserver.jdbc,driver-name=sqlserver,driver-class-name=#JDBC_DRIVER#)
/subsystem=datasources/data-source=#DATASOURCENAME#:add(jndi-name=java:jboss/#JNDI_NAME#,enabled="true",use-java-context="true",driver-name=sqlserver,connection-url="#JDBC_URL#",user-name=#JDBC_USER#,password=#JDBC_PASSWORD#,validate-on-match=true,background-validation=true)
replace #VAR# by our own value... and It should work!
Be caution than JBOSS/Wildfly 10 think relatively for jar --resources by default but wildfly 8 think absolute path this could make you weird ! ;-)
cheers!

VanillaSoftwareProcess Entity does not work in Apache Brooklyn

I have the last Apache Brooklyn (24.08.2015), Version: 0.8.0-SNAPSHOT, and when I am trying the example of the blueprint which is here: https://brooklyn.incubator.apache.org/v/latest/yaml/custom-entities.html
name: Simple Netcat Server Example
location: localhost
services:
- type: brooklyn.entity.basic.VanillaSoftwareProcess
name: Simple Netcat Server
launch.command: |
echo hello | nc -l 4321 &
echo $! > $PID_FILE
# The following overrides demonstrate the use of a custom shell environment as well as
# check-running and stop commands. These are optional; default behavior will "do the
# right thing" with the pid file automatically.
env: { CHECK_MARKER: "checkRunning", STOP_MARKER: "stop" }
checkRunning.command: echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p `cat $PID_FILE` >/dev/null
stop.command: echo $STOP_MARKER >> DATE && test -f "$PID_FILE" && { kill -9 `cat $PID_FILE`; rm /tmp/vanilla.pid; }
# can also define download.url, in which case the launch command defaults to ./start.sh in that (archive) file
When I tried to create the application with the Apache Brooklyn, I get an Internal error. I debugged the application, and the Exception I get is the following (PlanToSpecFactory.java):
java.lang.UnsupportedOperationException: Deployment plan item
org.apache.brooklyn.camp.spi.pdp.Service#62abec8e[name=Simple Netcat
Server,description=,serviceType=brooklyn.entity.basic.VanillaSoftwareProcess,characteristics=[],customAttributes={launch.command=echo
hello | nc -l 4321 & echo $! > $PID_FILE ,
env={CHECK_MARKER=checkRunning, STOP_MARKER=stop},
checkRunning.command=echo $CHECK_MARKER >> DATE && test -f "$PID_FILE"
&& ps -p cat $PID_FILE >/dev/null, stop.command=echo $STOP_MARKER
DATE && test -f "$PID_FILE" && { kill -9 cat $PID_FILE; rm /tmp/vanilla.pid; }}] cannot be matched
The trace in debug.log
DEBUG o.a.b.c.plan.PlanToSpecFactory
[brooklyn-jetty-server-8443-qtp1119923741-24]: Plan could not be
transformed; failure will be propagated (other transformers tried =
[]): [java.lang.IllegalArgumentException: Transformer for Brooklyn
OASIS CAMP interpreter gave an error creating this plan]
Any idea why? In the past this has worked
(I would like to post in the mailing list of Apache Brooklyn, but I get an error and I can not contact nobody)
The latest SNAPSHOT versions went through an heavy refactoring to change the package name to org.apache.brooklyn.*. That's probably why your version of Brooklyn cannot find the VanillaSoftwareProcess anymore.
Based on the Github repository, this entity is now located here: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess

jTSS "There seems no TCS running"

I want to use jTSS on my Ubuntu 14.04 64bits, I have an hardware TPM in version 1.2.
I installed the .deb like said in the section 4.3 http://trustedjava.sourceforge.net/index.php?item=jtss/readme
I started the daemon : jtss (TCS running)
But if I want to run the tests in your packages (run_tests_simple.sh or run_test.sh) I have the error :
"Error! No TSP-TCS binding could be initialized. Both jTSS Wrapper and jTSS were tried. Check the TSP configuration file."
And with this command 'jtt tpm_version', I have the same error :
---------------------
IAIK Java TPM Tools
---------------------
16:34:56:631 [ERROR] TcTcsBindingSoap::connect (116): There seems no TCS running
16:34:56:647 [ERROR] TcTcsBindingSoap::connect (116): There seems no TCS running
iaik.tc.tss.api.exceptions.tsp.TcTspException:
TSS Error:
error layer: 0x3000 (TSP)
error code (without layer): 0x0103
error code (full): 0x3103a
error message: Core Service connection failed.
at iaik.tc.tss.impl.java.tsp.tcsbinding.soapservice.TcTcsBindingSoap.connect(TcTcsBindingSoap.java:117)
at iaik.tc.tss.impl.java.tsp.internal.TcTspInternal.TspContextConnect_Internal(TcTspInternal.java:368)
at iaik.tc.tss.impl.java.tsp.TcContext.connect(TcContext.java:174)
at iaik.tc.apps.jtt.tpm.TpmVersion.execute(TpmVersion.java:68)
at iaik.tc.utils.cmdline.SubCommand.run(SubCommand.java:69)
at iaik.tc.utils.cmdline.SubCommandParser.parse(SubCommandParser.java:41)
at iaik.tc.apps.JTpmTools.main(JTpmTools.java:224)
I removed trousers, but keep in /etc/group : tss:x:126:root,jtss
Maybe your core service daemon was not started properly and isn't running. Have you seen this message on Trustedjava-support mailinglist?
Since you are using Ubuntu 14.04, you will have a jsvc version >= 1.0.11
Try to add the line
-cwd "${ROOT}/soap" \
to the jsvc call in the start() function in /etc/init.d/jtss.
The call should look something like this after editing:
${JSVC_EXECUTABLE} -pidfile "${PIDFILE}" \
-cwd "${ROOT}/soap" \
-outfile "${LOGFILE}" \
-errfile '&1' \
-Djtss.tsp.ini.file="${LIBS}/ini/jtss_tsp.ini" \
-Djtss.tcs.ini.file="${LIBS}/ini/jtss_tcs.ini" \
${USER:+-user "${USER}"} \
-wait ${TIMEOUT} \
-cp ${CLASSPATH_SOAP} ${EXECUTABLE}

jasmine_node failed while running mean-seed

Having trouble running a project generated by yeoman generator called mean-seed. I've been tinkering with it for a few days now and tried a couple things. Where I am having trouble is running the "jasmine_node" task:
Running "jasmine_node" task
>> Error: Unable to access jarfile node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar
Warning: Done, with errors. Use --force to continue.
Aborted due to warnings.
So I first tried identifying missing npm packages to install
744 npm install && bower update && bower install
755 npm install protractor
760 npm install npm install selenium-standalone
761 npm install -g protractor
765 npm install protractor-tester
767 npm install protractor-selenium-server-vagrant
768 npm install selenium-standalone#2.39.0-2.8.0-2
none of these actually created the file selenium-server-standalone-2.39.0.jar in the node_modules directory. I ran a find to check, however several other jars were install.
$ find . -name "*.jar" -print
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jline.jar
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/js.jar
./node_modules/selenium-standalone/.selenium/2.39.0/server.jar
I found the selenium server download so I tried downloading and copying it over to the referenced directory which I had to create
https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.39.0.jar
I run grunt again. It goes through tasks then runs the jasmine_node task
Running "jasmine_node" task
TEST configFile: /Users/jgs/Projects/mean/app/test/../configs/config.test.json
configFile: ./app/configs/config.test.json
info - socket.io started
waiting for server to be running..
[success] connected to db at localhost:27017/test_temp
>> Feb 01, 2014 3:03:54 PM org.openqa.grid.selenium.GridLauncher main
>> INFO: Launching a standalone server
>> Setting system property webdriver.chrome.driver to node_modules/protractor/selenium/chromedriver
------------------
[ERROR]
Run `node run.js config=test`
Server not connected. Ensure you have a node server running with the `config=test` command line option so this server connects to the TEST database - the same one used here for the tests. Do NOT connect to the live database for doing tests!
------------------
[success] connected to db at localhost:27017/test_temp
all tests - 2526 ms
should test everything - 2525 ms
Failures:
1) all tests should test everything
Message:
Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
Stacktrace:
Error: Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
at /Users/jgs/Projects/mean/app/test/all.spec.js:6:2935
at _rejected (/Users/jgs/Projects/mean/node_modules/q/q.js:808:24)
at /Users/jgs/Projects/mean/node_modules/q/q.js:834:30
at Promise.when (/Users/jgs/Projects/mean/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/jgs/Projects/mean/node_modules/q/q.js:752:41)
at /Users/jgs/Projects/mean/node_modules/q/q.js:574:44
at flush (/Users/jgs/Projects/mean/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
Finished in 2.53 seconds
1 test, 1 assertion, 1 failure, 0 skipped
Warning: Task "jasmine_node" failed. Use --force to continue.
Aborted due to warnings.
$
Any idea why jasmine task is still failing?
Run ./node_modules/protractor/bin/webdriver-manager update, see here for more info:
https://github.com/jackrabbitsgroup/generator-mean-seed/issues/5
I hadn't yet updated the documentation everywhere yet for the Protractor upgrade, sorry about that!
Here is my solution.
First you need to download both the selenium-server-standalone
https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.39.0.jar
and the chromedriver
http://chromedriver.storage.googleapis.com/index.html
copy them to
node_modules/protractor/selenium/
you will want another terminal tab or window to start the node server by runing
node run.js
then you can run the default grunt task
grunt
You will then see the output of the selenium tests in the console and chrome should open and perform the tests automatically.

Categories