@Override public ReceivePack create(DaemonClient req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = new ReceivePack(db); InetAddress peer = req.getRemoteAddress(); String host = peer.getCanonicalHostName(); if (host == null) host = peer.getHostAddress(); String name = "anonymous"; //$NON-NLS-1$ String email = name + "@" + host; //$NON-NLS-1$ rp.setRefLogIdent(new PersonIdent(name, email)); rp.setTimeout(getTimeout()); return rp; } };
private static ReceivePack createFor(final HttpServletRequest req, final Repository db, final String user) { final ReceivePack rp = new ReceivePack(db); rp.setRefLogIdent(toPersonIdent(req, user)); return rp; }
private static ReceivePack createFor(final HttpServletRequest req, final Repository db, final String user) { final ReceivePack rp = new ReceivePack(db); rp.setRefLogIdent(toPersonIdent(req, user)); return rp; }
public ReceivePack create(DaemonClient req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = new ReceivePack(db); InetAddress peer = req.getRemoteAddress(); String host = peer.getCanonicalHostName(); if (host == null) host = peer.getHostAddress(); String name = "anonymous"; //$NON-NLS-1$ String email = name + "@" + host; //$NON-NLS-1$ rp.setRefLogIdent(new PersonIdent(name, email)); rp.setTimeout(getTimeout()); return rp; } };
@Override public ReceivePack create(DaemonClient req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = new ReceivePack(db); InetAddress peer = req.getRemoteAddress(); String host = peer.getCanonicalHostName(); if (host == null) host = peer.getHostAddress(); String name = "anonymous"; //$NON-NLS-1$ String email = name + "@" + host; //$NON-NLS-1$ rp.setRefLogIdent(new PersonIdent(name, email)); rp.setTimeout(getTimeout()); return rp; } };
/** * Requires the admin access to be able to push */ @Override public ReceivePack createReceivePack(HttpServletRequest context, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { Authentication a = Jenkins.getAuthentication(); ReceivePack rp = createReceivePack(db); rp.setRefLogIdent(new PersonIdent(a.getName(),a.getName()+"@"+context.getRemoteAddr())); return rp; }
public ReceivePack create( DaemonClient req, Repository db ) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack rp = new ReceivePack( db ); InetAddress peer = req.getRemoteAddress(); String host = peer.getCanonicalHostName(); if ( host == null ) { host = peer.getHostAddress(); } String name = "anonymous"; String email = name + "@" + host; rp.setRefLogIdent( new PersonIdent( name, email ) ); rp.setTimeout( getTimeout() ); return rp; } };
@Override protected void runImpl() throws IOException, Failure { final ReceivePack rp = new ReceivePack(repo); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } catch (UnpackException badStream) { // This may have been triggered by branch level access controls. // Log what the heck is going on, as detailed as we can. // StringBuilder msg = new StringBuilder(); msg.append("Unpack error on project \"" + projectName() + "\":\n"); msg.append("\n"); IOException detail = new IOException(msg.toString(), badStream); throw new Failure(128, "fatal: Unpack error, check server log", detail); } }
@Override protected void runImpl() throws IOException, Failure { final ReceivePack rp = new ReceivePack(repo); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } catch (UnpackException badStream) { // This may have been triggered by branch level access controls. // Log what the heck is going on, as detailed as we can. // StringBuilder msg = new StringBuilder(); msg.append("Unpack error on project \"" + projectName() + "\":\n"); msg.append("\n"); IOException detail = new IOException(msg.toString(), badStream); throw new Failure(128, "fatal: Unpack error, check server log", detail); } }
public ReceiveCommits(UserProfile user, UserExtension extension, Repository repository, SpeakeasyService speakeasyService, GitRepositoryManager gitRepositoryManager) { this.user = user; this.extension = extension; this.repository = repository; this.speakeasyService = speakeasyService; this.gitRepositoryManager = gitRepositoryManager; this.rp = new ReceivePack(repository); final String email = user.getEmail(); final String name = user.getFullName(); rp.setRefLogIdent(new PersonIdent(name, email)); rp.setPreReceiveHook(this); rp.setPostReceiveHook(this); }
rp.setRefLogIdent(new PersonIdent("system", "system", new Date(1L),