private boolean verifyRepositoryConnection() {
		Project project = state.getProject();
		if (project != null) {
			RepositoryAdapter repository = project.getRepository();
			if (repository != null) {
				try {
					repository.connect();
				}
				catch (IOException e) {
					if ((e instanceof ConnectException) || (e instanceof NotConnectedException)) {
						return false;
					}

					if (isRunningHeadless()) {
						Msg.error(this,
							"Server Connect Error: Server repository connection failed: " +
								repository + ", Exception: " + e.toString());
					}
					else {
						PluginTool tool = state.getTool();
						Msg.showError(this, tool != null ? tool.getActiveWindow() : null,
							"Server Connect Error",
							"Server repository connection failed: " + repository, e);
					}
				}
				return repository.isConnected();
			}
			return true; // private project
		}
		return false; // no active project
	}
Enable use of anonymous read-only user connection to Ghidra Server in place of
fixed username/password credentials.
<p>
NOTE: Only used for Headless environment, other GUI environments should
continue to prompt user for login credentials as needed.

@return true if active project is either private or shared project is
connected to its server repository.  False is returned if not active
project or an active shared project failed to connect.
Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScript.java