| | |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.TimeZone; |
| | | |
| | |
| | | |
| | | import ro.fortsoft.pf4j.PluginState; |
| | | import ro.fortsoft.pf4j.PluginWrapper; |
| | | import ro.fortsoft.pf4j.Version; |
| | | |
| | | import com.gitblit.Constants; |
| | | import com.gitblit.Constants.AccessPermission; |
| | |
| | | import com.gitblit.transport.ssh.IPublicKeyManager; |
| | | import com.gitblit.transport.ssh.SshKey; |
| | | import com.gitblit.utils.ArrayUtils; |
| | | import com.gitblit.utils.XssFilter; |
| | | import com.gitblit.utils.HttpUtils; |
| | | import com.gitblit.utils.JsonUtils; |
| | | import com.gitblit.utils.ObjectCache; |
| | |
| | | RepositoryModel cloneModel = repository.cloneAs(cloneName); |
| | | // owner has REWIND/RW+ permissions |
| | | cloneModel.addOwner(user.username); |
| | | |
| | | // ensure initial access restriction of the fork |
| | | // is not lower than the source repository (issue-495/ticket-167) |
| | | if (repository.accessRestriction.exceeds(cloneModel.accessRestriction)) { |
| | | cloneModel.accessRestriction = repository.accessRestriction; |
| | | } |
| | | |
| | | repositoryManager.updateRepositoryModel(cloneName, cloneModel, false); |
| | | |
| | | // add the owner of the source repository to the clone's access list |
| | |
| | | // no user definitions, use system definitions |
| | | if (!clientApplications.hasCurrent("system", new Date(0))) { |
| | | try { |
| | | InputStream is = getClass().getResourceAsStream("/clientapps.json"); |
| | | InputStream is = GitblitManager.class.getResourceAsStream("/clientapps.json"); |
| | | Collection<GitClientApplication> clients = readClientApplications(is); |
| | | is.close(); |
| | | if (clients != null) { |
| | |
| | | // Read bundled Gitblit properties to extract setting descriptions. |
| | | // This copy is pristine and only used for populating the setting |
| | | // models map. |
| | | InputStream is = getClass().getResourceAsStream("/reference.properties"); |
| | | InputStream is = GitblitManager.class.getResourceAsStream("/reference.properties"); |
| | | BufferedReader propertiesReader = new BufferedReader(new InputStreamReader(is)); |
| | | StringBuilder description = new StringBuilder(); |
| | | SettingModel setting = new SettingModel(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean isServingHTTP() { |
| | | return runtimeManager.isServingHTTP(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isServingGIT() { |
| | | return runtimeManager.isServingGIT(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isServingSSH() { |
| | | return runtimeManager.isServingSSH(); |
| | | } |
| | | |
| | | @Override |
| | | public TimeZone getTimezone() { |
| | | return runtimeManager.getTimezone(); |
| | | } |
| | | |
| | | @Override |
| | | public Locale getLocale() { |
| | | return runtimeManager.getLocale(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return runtimeManager.getStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public XssFilter getXssFilter() { |
| | | return runtimeManager.getXssFilter(); |
| | | } |
| | | |
| | | /* |
| | | * NOTIFICATION MANAGER |
| | | */ |
| | | |
| | | @Override |
| | | public boolean isSendingMail() { |
| | | return notificationManager.isSendingMail(); |
| | | } |
| | | |
| | | @Override |
| | | public void sendMailToAdministrators(String subject, String message) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void resetRepositoryCache(String repositoryName) { |
| | | repositoryManager.resetRepositoryCache(repositoryName); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getRepositoryList() { |
| | | return repositoryManager.getRepositoryList(); |
| | | } |
| | |
| | | @Override |
| | | public void updateConfiguration(Repository r, RepositoryModel repository) { |
| | | repositoryManager.updateConfiguration(r, repository); |
| | | } |
| | | |
| | | @Override |
| | | public boolean canDelete(RepositoryModel model) { |
| | | return repositoryManager.canDelete(model); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | |
| | | @Override |
| | | public Version getSystemVersion() { |
| | | return pluginManager.getSystemVersion(); |
| | | } |
| | | |
| | | @Override |
| | | public void startPlugins() { |
| | | pluginManager.startPlugins(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean deletePlugin(String pluginId) { |
| | | return pluginManager.deletePlugin(pluginId); |
| | | public boolean uninstallPlugin(String pluginId) { |
| | | return pluginManager.uninstallPlugin(pluginId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean upgradePlugin(String pluginId, String url, boolean verifyChecksum) throws IOException { |
| | | return pluginManager.upgradePlugin(pluginId, url, verifyChecksum); |
| | | } |
| | | |
| | | @Override |
| | | public List<PluginRegistration> getRegisteredPlugins() { |
| | | return pluginManager.getRegisteredPlugins(); |
| | | } |