├── .gitignore ├── .nuget └── packages.config ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── Roadkill.sln ├── appveyor.yml ├── build ├── appveyor │ ├── install-chromedriver.ps1 │ ├── install-mongodb.ps1 │ └── set-connectionstrings.ps1 ├── build.ps1 ├── devbuild.ps1 ├── mono.releasebuild.ps1 ├── mono.sh └── upgrade.releasebuild.ps1 ├── docs ├── azure.md ├── common-issues.md ├── configuration.md ├── creating-and-editing-pages.md ├── custom-markup-tokens.md ├── images-and-media.md ├── importing-and-exporting.md ├── installing.md ├── rest-api.md ├── searching.md ├── text-plugins-special-urls.md ├── themes.md └── users-and-permissions.md ├── lib ├── Artwork │ ├── Logo │ │ ├── download.png │ │ ├── download.psd │ │ ├── edosz.ttf │ │ ├── favicon.png │ │ ├── installer.psd │ │ ├── roadkill-large.png │ │ ├── roadkill-large.psd │ │ ├── roadkill-small.psd │ │ ├── roadkill.png │ │ ├── roadkill32x32.png │ │ ├── screenshot1.png │ │ ├── screenshot2.png │ │ ├── screenshot3.png │ │ └── screenshot4.png │ └── roadkill-large.png ├── Configs │ ├── Roadkill.dev.config │ ├── Roadkill.download.config │ ├── Roadkill.windowsauth-acceptance.config │ ├── apache.txt │ ├── connectionStrings.appveyor.config │ ├── connectionStrings.config │ ├── connectionStrings.dev.config │ └── web.config ├── LightSpeed │ ├── Mindscape.LightSpeed.Linq.dll │ ├── Mindscape.LightSpeed.Linq.xml │ ├── Mindscape.LightSpeed.MetaData.dll │ ├── Mindscape.LightSpeed.MetaData.xml │ ├── Mindscape.LightSpeed.ServiceModel.DomainServices.dll │ ├── Mindscape.LightSpeed.ServiceModel.dll │ ├── Mindscape.LightSpeed.ServiceModel.xml │ ├── Mindscape.LightSpeed.Web.DynamicData.dll │ ├── Mindscape.LightSpeed.Web.dll │ ├── Mindscape.LightSpeed.Web.xml │ ├── Mindscape.LightSpeed.dll │ ├── Mindscape.LightSpeed.xml │ └── Providers │ │ ├── AWSSDK.dll │ │ ├── Commons.dll │ │ ├── ICSharpCode.SharpZipLib.dll │ │ ├── Lucene.Net.dll │ │ ├── Memcached.ClientLibrary.dll │ │ ├── Microsoft.WindowsAzure.StorageClient.dll │ │ ├── Mindscape.LightSpeed.Providers.AmazonSimpleDB.dll │ │ ├── Mindscape.LightSpeed.Providers.DB2.dll │ │ ├── Mindscape.LightSpeed.Providers.SqlServerCe35.dll │ │ ├── Mindscape.LightSpeed.Providers.SqlServerCe4.dll │ │ ├── Mindscape.LightSpeed.Providers.VistaDB4.dll │ │ ├── Mindscape.LightSpeed.Providers.WindowsAzure.dll │ │ ├── Mono.Security.dll │ │ ├── MySql.Data.dll │ │ ├── Npgsql.dll │ │ ├── Oracle.DataAccess.dll │ │ ├── System.Data.SQLite.DLL │ │ └── log4net.dll ├── Microsoft.Web.Administration.dll ├── Test-databases │ ├── Upgrade │ │ ├── roadkill152.sdf │ │ ├── roadkill152.sqlite │ │ └── roadkill152.sqlserver.sql │ ├── readme.txt │ ├── roadkill-postgres.sql │ └── roadkill-sqlserver.sql └── WebPI │ ├── Manifest.xml │ ├── Parameters.xml │ └── fciv.exe ├── setup.ps1 └── src ├── Roadkill.Core ├── Attachments │ ├── AttachmentFileHandler.cs │ ├── AttachmentPathUtil.cs │ ├── AttachmentRouteHandler.cs │ ├── IResponseWrapper.cs │ ├── MimeTypes.cs │ └── ResponseWrapper.cs ├── Cache │ ├── CacheKeys.cs │ ├── IPluginCache.cs │ ├── ListCache.cs │ ├── PageViewModelCache.cs │ └── SiteCache.cs ├── Configuration │ ├── ApplicationSettings.cs │ ├── ConfigReaderWriter.cs │ ├── FullTrustConfigReaderWriter.cs │ ├── RoadkillSection.cs │ └── SiteSettings.cs ├── Database │ ├── Entities │ │ ├── IDataStoreEntity.cs │ │ ├── Page.cs │ │ ├── PageContent.cs │ │ ├── SiteConfigurationEntity.cs │ │ └── User.cs │ ├── Export │ │ └── SqlExportBuilder.cs │ ├── IRepositoryFactory.cs │ ├── Repositories │ │ ├── Dapper │ │ │ ├── DapperInstallerRepository.cs │ │ │ ├── DapperPageRepository.cs │ │ │ ├── DapperSettingsRepository.cs │ │ │ ├── DapperUserRepository.cs │ │ │ ├── IDbConnectionFactory.cs │ │ │ ├── PostgresConnectionFactory.cs │ │ │ └── SqlConnectionFactory.cs │ │ ├── DatabaseTester.cs │ │ ├── IDatabaseTester.cs │ │ ├── IInstallerRepository.cs │ │ ├── IPageRepository.cs │ │ ├── ISettingsRepository.cs │ │ ├── IUserRepository.cs │ │ ├── Lightspeed │ │ │ ├── Conversion │ │ │ │ ├── FromEntity.cs │ │ │ │ └── ToEntity.cs │ │ │ ├── DatabaseLogger.cs │ │ │ ├── LightSpeedInstallerRepository.cs │ │ │ ├── LightSpeedPageRepository.cs │ │ │ ├── LightSpeedSettingsRepository.cs │ │ │ ├── LightSpeedUserRepository.cs │ │ │ ├── PageContentEntity.cs │ │ │ ├── PageEntity.cs │ │ │ ├── SiteConfigurationEntity.cs │ │ │ └── UserEntity.cs │ │ └── MongoDB │ │ │ ├── MongoDBPageRepository.cs │ │ │ ├── MongoDBSettingsRepository.cs │ │ │ ├── MongoDBUserRepository.cs │ │ │ └── MongoDbInstallerRepository.cs │ ├── RepositoryFactory.cs │ ├── RepositoryInfo.cs │ ├── Schema │ │ ├── MySql │ │ │ ├── Create.sql │ │ │ ├── Drop.sql │ │ │ └── MySqlSchema.cs │ │ ├── Postgres │ │ │ ├── Create.sql │ │ │ ├── Drop.sql │ │ │ └── PostgresSchema.cs │ │ ├── SchemaBase.cs │ │ └── SqlServer │ │ │ ├── Create.sql │ │ │ ├── Drop.sql │ │ │ └── SqlServerSchema.cs │ └── SupportedDatabases.cs ├── DependencyResolution │ ├── ISetterInjected.cs │ ├── LocatorStartup.cs │ ├── MVC │ │ ├── MvcAttributeProvider.cs │ │ └── MvcModelBinders.cs │ └── StructureMap │ │ ├── LightSpeedRegistry.cs │ │ ├── RoadkillRegistry.cs │ │ ├── StructureMapHttpModule.cs │ │ └── StructureMapServiceLocator.cs ├── Email │ ├── EmailClient.cs │ ├── EmailTemplate.cs │ ├── IEmailClient.cs │ ├── ResetPasswordEmail.cs │ └── SignupEmail.cs ├── Exceptions │ ├── ConfigurationException.cs │ ├── DatabaseException.cs │ ├── EmailException.cs │ ├── ExceptionBase.cs │ ├── FileException.cs │ ├── HistoryException.cs │ ├── InstallerException.cs │ ├── IoCException.cs │ ├── PluginException.cs │ ├── SearchException.cs │ └── SecurityException.cs ├── Export │ └── WikiExporter.cs ├── Extensions │ ├── BootstrapHtmlExtensions.cs │ ├── Extensions.cs │ ├── HtmlHelperExtensions.cs │ ├── HtmlHelperLinkExtensions.cs │ └── UrlHelperExtensions.cs ├── Import │ ├── IWikiImporter.cs │ ├── MatchComparer.cs │ ├── ScrewTurnImporter.cs │ └── ScrewTurnMigrationExtensions.cs ├── Localization │ ├── InstallStrings.Designer.cs │ ├── InstallStrings.ca.resx │ ├── InstallStrings.cs.resx │ ├── InstallStrings.de.resx │ ├── InstallStrings.es.resx │ ├── InstallStrings.hi.resx │ ├── InstallStrings.it.resx │ ├── InstallStrings.nl.resx │ ├── InstallStrings.pl.resx │ ├── InstallStrings.pt.resx │ ├── InstallStrings.resx │ ├── InstallStrings.ru.resx │ ├── InstallStrings.sv.resx │ ├── LocalizationTokens.cs │ ├── SiteStrings.Designer.cs │ ├── SiteStrings.ca.resx │ ├── SiteStrings.cs.resx │ ├── SiteStrings.de.resx │ ├── SiteStrings.es.resx │ ├── SiteStrings.hi.resx │ ├── SiteStrings.it.resx │ ├── SiteStrings.nl.resx │ ├── SiteStrings.pl.resx │ ├── SiteStrings.pt.resx │ ├── SiteStrings.resx │ ├── SiteStrings.ru.resx │ ├── SiteStrings.sv.resx │ └── readme.txt ├── Logging │ ├── Level.cs │ └── Log.cs ├── Mvc │ ├── Attributes │ │ ├── AdminRequiredAttribute.cs │ │ ├── BrowserCacheAttribute.cs │ │ ├── CacheContentTypeAttribute.cs │ │ ├── EditorRequiredAttribute.cs │ │ ├── ExportModelStateAttribute.cs │ │ ├── IAuthorizationAttribute.cs │ │ ├── ImportModelStateAttribute.cs │ │ ├── OptionalAuthorizationAttribute.cs │ │ └── RecaptchaRequiredAttribute.cs │ ├── Controllers │ │ ├── ConfigurationTesterController.cs │ │ ├── ControllerBase.cs │ │ ├── FileManagerController.cs │ │ ├── HelpController.cs │ │ ├── HomeController.cs │ │ ├── IRoadkillController.cs │ │ ├── InstallController.cs │ │ ├── PagesController.cs │ │ ├── SiteSettings │ │ │ ├── CacheController.cs │ │ │ ├── PluginSettingsController.cs │ │ │ ├── SettingsController.cs │ │ │ ├── SiteSettingsAreaRegistration.cs │ │ │ ├── ToolsController.cs │ │ │ ├── UserController.cs │ │ │ └── UserManagementController.cs │ │ ├── SpecialPagesController.cs │ │ └── WikiController.cs │ ├── Setup │ │ ├── Bundles.cs │ │ ├── ExtendedRazorViewEngine.cs │ │ ├── LowercaseRoute.cs │ │ ├── Routing.cs │ │ └── SwashbuckleApplyApiKeySecurity.cs │ ├── ViewModels │ │ ├── CacheViewModel.cs │ │ ├── DirectoryViewModel.cs │ │ ├── FileViewModel.cs │ │ ├── LanguageViewModel.cs │ │ ├── PageHistoryViewModel.cs │ │ ├── PageViewModel.cs │ │ ├── PluginViewModel.cs │ │ ├── SearchResultViewModel.cs │ │ ├── SettingsViewModel.cs │ │ ├── TagViewModel.cs │ │ ├── TestResult.cs │ │ └── UserViewModel.cs │ ├── WebApi │ │ ├── ApiKeyAuthorizeAttribute.cs │ │ ├── PagesController.cs │ │ ├── SearchController.cs │ │ └── UserController.cs │ └── WebViewPages │ │ ├── RoadkillLayoutPage.cs │ │ └── RoadkillViewPage.cs ├── Owin │ └── InstallCheckMiddleware.cs ├── Plugins │ ├── IPluginFactory.cs │ ├── PluginFactory.cs │ ├── PluginFileManager.cs │ ├── SettingFormType.cs │ ├── SettingValue.cs │ ├── Settings.cs │ ├── SpecialPagePlugin.cs │ └── TextPlugin.cs ├── Properties │ └── AssemblyInfo.cs ├── Roadkill.Core.csproj ├── Security │ ├── AuthorizationProvider.cs │ ├── FormsAuthUserService.cs │ ├── FormsAuthenticationWrapper.cs │ ├── IAuthorizationProvider.cs │ ├── IUserContext.cs │ ├── Salt.cs │ ├── UserContext.cs │ ├── UserServiceBase.cs │ └── Windows │ │ ├── ActiveDirectoryProvider.cs │ │ ├── ActiveDirectoryUserService.cs │ │ ├── IActiveDirectoryProvider.cs │ │ ├── IPrincipalDetails.cs │ │ └── PrincipalDetails.cs ├── Services │ ├── AzureFileService.cs │ ├── IFileService.cs │ ├── IInstallationService.cs │ ├── IPageService.cs │ ├── ISearchService.cs │ ├── ISettingsService.cs │ ├── InstallationService.cs │ ├── LocalFileService.cs │ ├── PageHistoryService.cs │ ├── PageService.cs │ ├── SearchService.cs │ └── SettingsService.cs ├── Startup.cs ├── Text │ ├── CustomTokenParser.cs │ ├── HtmlDiff.cs │ ├── IMarkupParser.cs │ ├── ImageEventArgs.cs │ ├── LinkEventArgs.cs │ ├── MarkupConverter.cs │ ├── MarkupLinkUpdater.cs │ ├── MarkupParserHelp.cs │ ├── MenuParser.cs │ ├── PageHtml.cs │ ├── Parsers │ │ ├── Legacy │ │ │ └── CreoleParser.cs │ │ └── Markdown.cs │ ├── Sanitizer │ │ ├── HtmlAttribute.cs │ │ ├── HtmlElement.cs │ │ └── HtmlWhiteList.cs │ ├── TextPluginRunner.cs │ ├── TextToken.cs │ └── UrlResolver.cs └── packages.config ├── Roadkill.Plugins ├── Properties │ └── AssemblyInfo.cs ├── Roadkill.Plugins.csproj ├── SpecialPages │ └── BuiltIn │ │ └── RandomPage.cs ├── TestUserService.cs ├── Text │ └── BuiltIn │ │ ├── ClickableImages.cs │ │ ├── ExternalLinksInNewWindow.cs │ │ ├── Jumbotron.cs │ │ ├── MathJax.cs │ │ ├── ResizeImages.cs │ │ ├── SyntaxHighlighter.cs │ │ └── ToC │ │ ├── Item.cs │ │ ├── StringTemplate.cs │ │ ├── TocParser.cs │ │ ├── TocPlugin.cs │ │ └── Tree.cs ├── app.config └── packages.config ├── Roadkill.Tests ├── Acceptance │ ├── Headless │ │ └── RestApi │ │ │ ├── ApiKeysTests.cs │ │ │ ├── PageControllerTests.cs │ │ │ ├── SearchControllerTests.cs │ │ │ ├── UserControllerTests.cs │ │ │ ├── WebApiClient.cs │ │ │ ├── WebApiResponse.cs │ │ │ └── WebApiTestBase.cs │ └── Webdriver │ │ ├── AcceptanceTestBase.cs │ │ ├── AcceptanceTestsSetup.cs │ │ ├── FileManagerTests.cs │ │ ├── InstallerTests.cs │ │ ├── LocalizationTests.cs │ │ ├── LoginTests.cs │ │ ├── PageTests.cs │ │ ├── SearchTests.cs │ │ ├── SettingsTests.cs │ │ ├── UserTests.cs │ │ └── WebDriverExtensions.cs ├── Integration │ ├── Configuration │ │ ├── ApplicationSettingsTests.cs │ │ ├── FullTrustConfigReaderWriterTests.cs │ │ └── TestConfigs │ │ │ ├── test-empty-defaults.config │ │ │ ├── test-empty.config │ │ │ ├── test-missing-values.config │ │ │ ├── test-mongodb.config │ │ │ ├── test-no-roadkillsection.config │ │ │ ├── test-optional-values.config │ │ │ └── test.config │ ├── Import │ │ ├── ScrewturnImporterTests.cs │ │ └── screwturn3.sql │ ├── Repository │ │ ├── Dapper │ │ │ ├── DapperInstallerRepositoryTests.cs │ │ │ ├── DapperPageRepositoryTests.cs │ │ │ ├── DapperSettingsRepositoryTests.cs │ │ │ └── DapperUserRepositoryTests.cs │ │ ├── InstallerRepositoryTests.cs │ │ ├── LightSpeed │ │ │ ├── LightSpeedInstallerRepositoryTests.cs │ │ │ ├── LightSpeedPageRepositoryTests.cs │ │ │ ├── LightSpeedSettingsRepositoryTests.cs │ │ │ └── LightSpeedUserRepositoryTests.cs │ │ ├── MongoDb │ │ │ ├── MongoDbInstallerRepositoryTests.cs │ │ │ ├── MongoDbPageRepositoryTests.cs │ │ │ ├── MongoDbSettingsRepositoryTests.cs │ │ │ └── MongoDbUserRepositoryTests.cs │ │ ├── PageRepositoryTests.cs │ │ ├── SettingsRepositoryTests.cs │ │ └── UserRepositoryTests.cs │ ├── Search │ │ └── SearchServiceTests.cs │ └── windows-auth-testing.txt ├── Javascript │ ├── editpage-tests.ts │ └── qunit.d.ts ├── Properties │ └── AssemblyInfo.cs ├── Roadkill.Tests.csproj ├── Roadkill.Tests.csproj.VisualState.xml ├── Scripts │ └── typings │ │ └── qunit │ │ └── qunit.d.ts ├── TestConstants.cs ├── TestHelpers.cs ├── Unit │ ├── Attachments │ │ ├── AttachmentFileHandlerTests.cs │ │ ├── AttachmentPathUtilTests.cs │ │ ├── MimeMappingTests.cs │ │ ├── ResponseWrapperMock.cs │ │ └── afile.jpg │ ├── Cache │ │ ├── ListCacheTests.cs │ │ ├── PageServiceCacheTests.cs │ │ ├── PageViewModelCacheTests.cs │ │ └── SiteCacheTests.cs │ ├── Database │ │ ├── EntityTests.cs │ │ ├── LightSpeed │ │ │ ├── FromEntityTests.cs │ │ │ └── ToEntityTests.cs │ │ ├── RepositoryFactoryTests.cs │ │ ├── RepositoryInfoTests.cs │ │ ├── SchemaTests.cs │ │ └── SiteSettingsTests.cs │ ├── DependencyResolution │ │ ├── LocatorStartupTests.cs │ │ └── RoadkillRegistryTests.cs │ ├── Email │ │ └── EmailTemplateTests.cs │ ├── Export │ │ ├── SqlExportBuilderTests.cs │ │ ├── WikiExporterTests.cs │ │ ├── expected-pages-export.sql │ │ ├── expected-siteconfiguration-export.sql │ │ └── expected-users-export.sql │ ├── Extensions │ │ ├── ExtensionsTests.cs │ │ ├── HtmlHelperExtensionTests.cs │ │ ├── HtmlHelperLinkExtensionsTests.cs │ │ └── UrlHelperExtensionsTests.cs │ ├── Import │ │ └── ScrewTurnImportExtensionTests.cs │ ├── Logging │ │ └── LoggingTests.cs │ ├── MocksAndStubsContainer.cs │ ├── Mvc │ │ ├── Attributes │ │ │ ├── AdminRequiredAttributeTests.cs │ │ │ ├── BrowserCacheAttributeTests.cs │ │ │ ├── EditorRequiredAttributeTests.cs │ │ │ └── OptionalAuthorizationTests.cs │ │ ├── Controllers │ │ │ ├── ConfigurationTesterControllerTests.cs │ │ │ ├── ControllerBaseTests.cs │ │ │ ├── FileManagerControllerTests.cs │ │ │ ├── HelpControllerTests.cs │ │ │ ├── HomeControllerTests.cs │ │ │ ├── InstallControllerTests.cs │ │ │ ├── PagesControllerTests.cs │ │ │ ├── PluginSettingsControllerTests.cs │ │ │ ├── SiteSettings │ │ │ │ ├── CacheControllerTests.cs │ │ │ │ ├── SettingsControllerTests.cs │ │ │ │ ├── ToolsControllerTests.cs │ │ │ │ └── UserManagementControllerTests.cs │ │ │ ├── SpecialPagesControllerTests.cs │ │ │ ├── UserControllerTests.cs │ │ │ └── WikiControllerTests.cs │ │ ├── Setup │ │ │ ├── ResponseWrapperTests.cs │ │ │ └── RoutingTests.cs │ │ ├── ViewModels │ │ │ ├── DirectoryViewModelTests.cs │ │ │ ├── FileViewModelTests.cs │ │ │ ├── LanguageViewModelTests.cs │ │ │ ├── PageHistoryViewModelTests.cs │ │ │ ├── PageViewModelTests.cs │ │ │ ├── PageViewModelValidationTests.cs │ │ │ ├── PluginViewModelTests.cs │ │ │ ├── SearchResultViewModelTests.cs │ │ │ ├── SettingsViewModelTests.cs │ │ │ ├── TagViewModelTests.cs │ │ │ ├── TestResultTests.cs │ │ │ ├── UserViewModelEmailValidationTests.cs │ │ │ ├── UserViewModelPasswordValidationTests.cs │ │ │ ├── UserViewModelTests.cs │ │ │ └── UserViewModelUsernameValidationTests.cs │ │ └── WebApi │ │ │ ├── PageControllerTests.cs │ │ │ ├── SearchControllerTests.cs │ │ │ └── UserControllerTests.cs │ ├── MvcActionExtensions.cs │ ├── Owin │ │ └── InstallCheckMiddlewareTests.cs │ ├── Plugins │ │ ├── JumbotronTests.cs │ │ ├── MathJaxTests.cs │ │ ├── PluginFactoryTests.cs │ │ ├── PluginFileManagerTests.cs │ │ ├── RandomPageTests.cs │ │ ├── SettingsTests.cs │ │ ├── SyntaxHighlighterTests.cs │ │ ├── TextPluginTests.cs │ │ └── TocParserTests.cs │ ├── Security │ │ └── AuthorizationProviderTests.cs │ ├── Services │ │ ├── ActiveDirectoryUserManagerTests.cs │ │ ├── FormsAuthUserServiceTests.cs │ │ ├── InstallationServiceTests.cs │ │ ├── LocalFileServiceTests.cs │ │ ├── PageHistoryServiceTests.cs │ │ ├── PageServiceTests.cs │ │ └── SettingsServiceTests.cs │ ├── StubsAndMocks │ │ ├── ActiveDirectoryProviderMock.cs │ │ ├── AuthorizationProviderMock.cs │ │ ├── CacheMock.cs │ │ ├── ConfigReaderWriterStub.cs │ │ ├── DatabaseTesterMock.cs │ │ ├── DbCommandStub.cs │ │ ├── EmailClientMock.cs │ │ ├── EmailTemplateStub.cs │ │ ├── FileServiceMock.cs │ │ ├── IdentityStub.cs │ │ ├── InstallerRepositoryMock.cs │ │ ├── Mvc │ │ │ ├── HttpCachePolicyMock.cs │ │ │ ├── MvcMockContainer.cs │ │ │ └── MvcMockHelpers.cs │ │ ├── Owin │ │ │ ├── OwinContextStub.cs │ │ │ └── OwinRequestStub.cs │ │ ├── PageRepositoryMock.cs │ │ ├── PluginFactoryMock.cs │ │ ├── PrincipalStub.cs │ │ ├── RepositoryFactoryMock.cs │ │ ├── ResetPasswordEmailStub.cs │ │ ├── SearchServiceMock.cs │ │ ├── SettingsRepositoryMock.cs │ │ ├── SignupEmailStub.cs │ │ ├── SpecialPageMock.cs │ │ ├── TextPluginStub.cs │ │ ├── UrlResolverStub.cs │ │ ├── UserContextStub.cs │ │ ├── UserRepositoryMock.cs │ │ ├── UserServiceMock.cs │ │ ├── UserServiceStub.cs │ │ └── WikiImporterMock.cs │ └── Text │ │ ├── CreoleParserTests.cs │ │ ├── CustomTokenParserTests.cs │ │ ├── MarkdownTests.cs │ │ ├── MarkupConverterTests.cs │ │ ├── MarkupLinkUpdaterTests.cs │ │ ├── MenuParserTests.cs │ │ └── whitelist.xml ├── app.config ├── chromedriver.exe └── packages.config └── Roadkill.Web ├── App_Data ├── Attachments │ └── emptyfile.txt ├── EmailTemplates │ ├── ResetPassword.html │ ├── ResetPassword.txt │ ├── Signup.html │ └── Signup.txt ├── Internal │ ├── Export │ │ └── emptyfile.txt │ └── htmlwhitelist.xml ├── Logs │ └── emptyfile.txt ├── NLog.config ├── customvariables.xml ├── roadkill-acceptancetests.sdf ├── roadkill.mdf └── roadkill152.sdf ├── Areas └── SiteSettings │ ├── Views │ ├── Cache │ │ └── Index.cshtml │ ├── PluginSettings │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Settings │ │ └── Index.cshtml │ ├── Shared │ │ └── Navigation.cshtml │ ├── Tools │ │ └── Index.cshtml │ ├── UserManagement │ │ ├── AddAdmin.cshtml │ │ ├── AddEditor.cshtml │ │ ├── EditUser.cshtml │ │ ├── Index.cshtml │ │ └── IndexReadOnly.cshtml │ └── _ViewStart.cshtml │ └── Web.config ├── Assets ├── Bootstrap │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── respond.min.js ├── CSS │ ├── _apihelp.scss │ ├── _htmldiff.scss │ ├── _jquery-ui-bootstrap.scss │ ├── _jquery.fileupload.scss │ ├── _tagmanager.scss │ ├── _toastr.scss │ ├── images │ │ ├── animated-overlay.gif │ │ ├── blank.gif │ │ ├── plugin-disabled.png │ │ ├── plugin-enabled.png │ │ ├── spinner.gif │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_75_ffffff_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ ├── roadkill.css │ ├── roadkill.installer.css │ ├── roadkill.installer.scss │ └── roadkill.scss ├── Images │ ├── button-loading.gif │ ├── favicon.png │ ├── filemanager │ │ ├── cancel.png │ │ ├── directory.png │ │ └── file.png │ ├── installer-ex-chicken.png │ ├── roadkill.png │ └── white-loading.gif ├── Scripts │ ├── jquery │ │ ├── additional-methods.js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-ui-1.10.3.custom.js │ │ ├── jquery.fieldSelection.js │ │ ├── jquery.fileupload.js │ │ ├── jquery.form-extensions.js │ │ ├── jquery.iframe-transport.js │ │ ├── jquery.timeago.js │ │ └── jquery.validate.js │ ├── readme.txt │ ├── roadkill.js │ ├── roadkill │ │ ├── dialogs.ts │ │ ├── editpage │ │ │ ├── editpage.ts │ │ │ └── wysiwygeditor.ts │ │ ├── filemanager │ │ │ ├── ajaxrequest.ts │ │ │ ├── breadcrumbtrail.ts │ │ │ ├── buttonevents.ts │ │ │ ├── htmlbuilder.ts │ │ │ ├── setup.ts │ │ │ ├── tableevents.ts │ │ │ └── util.ts │ │ ├── installer │ │ │ ├── installwizard.ts │ │ │ ├── step1.ts │ │ │ ├── step2.ts │ │ │ ├── step3Db.ts │ │ │ ├── step3WindowsAuth.ts │ │ │ ├── step4.ts │ │ │ └── step5.ts │ │ ├── setup.ts │ │ ├── sitesettings │ │ │ └── settings.ts │ │ ├── typescript-ref │ │ │ ├── constants.ts │ │ │ ├── directoryviewmodel.ts │ │ │ ├── filemanager.references.ts │ │ │ ├── filemodel.ts │ │ │ ├── installerconstants.js │ │ │ ├── installerconstants.ts │ │ │ └── references.ts │ │ └── validation.ts │ └── shared │ │ ├── bootbox.js │ │ ├── head.js │ │ ├── tagmanager.js │ │ └── toastr.js ├── opensearch.xml └── web.config ├── Plugins ├── ClickableImages │ └── clickableimages.js ├── ExternalLinksInNewWindow │ └── ExternalLinksInNewWindow.js ├── Jumbotron │ └── jumbotron.css ├── ResizeImages │ └── resizeimages.css ├── SyntaxHighlighter │ ├── css │ │ ├── shCore.css │ │ ├── shCoreDefault.css │ │ ├── shCoreDjango.css │ │ ├── shCoreEclipse.css │ │ ├── shCoreEmacs.css │ │ ├── shCoreFadeToGrey.css │ │ ├── shCoreMDUltra.css │ │ ├── shCoreMidnight.css │ │ ├── shCoreRDark.css │ │ ├── shThemeDefault.css │ │ ├── shThemeDjango.css │ │ ├── shThemeEclipse.css │ │ ├── shThemeEmacs.css │ │ ├── shThemeFadeToGrey.css │ │ ├── shThemeMDUltra.css │ │ ├── shThemeMidnight.css │ │ └── shThemeRDark.css │ └── javascript │ │ ├── shAutoloader.js │ │ ├── shBrushAS3.js │ │ ├── shBrushAppleScript.js │ │ ├── shBrushBash.js │ │ ├── shBrushCSharp.js │ │ ├── shBrushColdFusion.js │ │ ├── shBrushCpp.js │ │ ├── shBrushCss.js │ │ ├── shBrushDelphi.js │ │ ├── shBrushDiff.js │ │ ├── shBrushErlang.js │ │ ├── shBrushGroovy.js │ │ ├── shBrushJScript.js │ │ ├── shBrushJava.js │ │ ├── shBrushJavaFX.js │ │ ├── shBrushPerl.js │ │ ├── shBrushPhp.js │ │ ├── shBrushPlain.js │ │ ├── shBrushPowerShell.js │ │ ├── shBrushPython.js │ │ ├── shBrushRuby.js │ │ ├── shBrushSass.js │ │ ├── shBrushScala.js │ │ ├── shBrushSql.js │ │ ├── shBrushVb.js │ │ ├── shBrushXml.js │ │ ├── shCore.js │ │ └── shLegacy.js ├── Toc │ ├── toc.css │ └── toc.js ├── Web.config └── _ViewStart.cshtml ├── Properties └── AssemblyInfo.cs ├── Roadkill.Web.csproj ├── Roadkill.config ├── Roadkill.dev.config ├── Themes ├── BlackBar │ ├── Theme.cshtml │ ├── Theme.css │ └── Theme.print.css ├── Mediawiki │ ├── Theme.cshtml │ ├── Theme.css │ ├── Theme.print.css │ ├── border.png │ ├── logo.png │ ├── page-fade.png │ ├── pagebg.png │ └── search.png ├── Plain │ ├── Theme.cshtml │ ├── Theme.css │ └── Theme.print.css ├── Responsive │ ├── Theme.cshtml │ ├── Theme.css │ └── Theme.print.css └── Web.config ├── Views ├── FileManager │ ├── Index.cshtml │ ├── Navigator.cshtml │ └── Select.cshtml ├── Help │ ├── CreoleReference.cshtml │ ├── Index.cshtml │ ├── MarkdownReference.cshtml │ └── MediaWikiReference.cshtml ├── Home │ ├── GlobalJsVars.cshtml │ ├── Index.cshtml │ └── Search.cshtml ├── Install │ ├── Index.cshtml │ ├── InstallerJsVars.cshtml │ ├── Layout.cshtml │ ├── Step1.cshtml │ ├── Step2.cshtml │ ├── Step3.cshtml │ ├── Step3Database.cshtml │ ├── Step3WindowsAuth.cshtml │ ├── Step4.cshtml │ └── Step5.cshtml ├── Pages │ ├── AllPages.cshtml │ ├── AllTags.cshtml │ ├── ByUser.cshtml │ ├── Dialogs │ │ ├── ChooseImage.cshtml │ │ ├── MarkupHelp.cshtml │ │ └── PreviewPage.cshtml │ ├── Edit.cshtml │ ├── History.cshtml │ ├── Tag.cshtml │ ├── Version.cshtml │ └── WysiwgToolbar.cshtml ├── Shared │ ├── Dialogs │ │ └── PageInformation.cshtml │ ├── Error.cshtml │ ├── HeadContent.cshtml │ ├── TagBlocks.cshtml │ └── _Blank.cshtml ├── User │ ├── Activate.cshtml │ ├── BlankLogin.cshtml │ ├── CompleteResetPassword.cshtml │ ├── CompleteResetPasswordInvalid.cshtml │ ├── CompleteResetPasswordSuccessful.cshtml │ ├── LeftMenu.cshtml │ ├── LoggedInAs.cshtml │ ├── Login.cshtml │ ├── Profile.cshtml │ ├── Recaptcha.cshtml │ ├── ResetPassword.cshtml │ ├── ResetPasswordSent.cshtml │ ├── Signup.cshtml │ └── SignupComplete.cshtml ├── Web.config ├── Wiki │ ├── 404.cshtml │ ├── 500.cshtml │ ├── Index.cshtml │ └── PageToolbar.cshtml └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── connectionStrings.config ├── gruntfile.js ├── package.json ├── packages.config └── web.config /.nuget/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | solution: Roadkill.sln 3 | 4 | install: 5 | - nuget restore Roadkill.sln 6 | - nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner 7 | - export PATH=$PATH:$PWD/lib 8 | - echo $PATH 9 | - echo $PWD 10 | script: 11 | - xbuild /p:Configuration=Mono Roadkill.sln 12 | - mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./src/Roadkill.Tests/bin/Mono/Roadkill.Tests.dll /include:Unit 13 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 2.0.{build} 2 | shallow_clone: true 3 | clone_depth: 1 4 | 5 | branches: 6 | only: 7 | - master 8 | 9 | services: 10 | - mssql2012sp1 11 | - iis 12 | - mongodb 13 | 14 | environment: 15 | ConnectionString: Server=(local)\SQL2012SP1;Database=master;User ID=sa;Password=Password12! 16 | COVERALLS_REPO_TOKEN: 17 | secure: VwMSUv6m2x21/AfgTZY9+hxfSBAjRL0gScLpmwpZk6W0LujzCZ1atvFGBRT5HGrC 18 | 19 | cache: 20 | - packages -> **\packages.config 21 | 22 | build_script: 23 | - ps: .\build\build.ps1 24 | 25 | test: 26 | categories: 27 | - Unit 28 | - Integration 29 | 30 | after_test: 31 | - packages\OpenCover.4.6.166\tools\OpenCover.Console.exe -register:user -filter:"+[Roadkill*]* -[Roadkill.Tests*]* -[*]*Exception*" -excludebyfile:*.Designer.cs;*HtmlDiff.cs -target:"packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" -targetargs:"/noshadow /domain:single /include=Unit,Integration src\Roadkill.Tests\bin\release\Roadkill.Tests.dll" -output:coverage.xml 32 | - packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover coverage.xml 33 | - ps: >- 34 | Copy-item -Path "lib\configs\connectionStrings.config" -Destination "src\Roadkill.Web\connectionStrings.config"; 35 | del "src\Roadkill.Web\Web.Debug.config"; 36 | del "src\Roadkill.Web\Web.Release.config"; 37 | -------------------------------------------------------------------------------- /build/appveyor/install-mongodb.ps1: -------------------------------------------------------------------------------- 1 | $url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.4-signed.msi" 2 | $msiPath = "$($env:USERPROFILE)\mongodb-win32-x86_64-2008plus-ssl-3.0.4-signed.msi" 3 | 4 | Write-Host "Downloading $url to $msiPath..." 5 | (New-Object Net.WebClient).DownloadFile($url, $msiPath) 6 | Write-Host "Done" 7 | 8 | Write-Host "Launching MSI installer" 9 | cmd /c start /wait msiexec /q /i $msiPath INSTALLLOCATION=C:\mongodb ADDLOCAL="all" 10 | del $msiPath 11 | 12 | mkdir c:\mongodb\data\db | Out-Null 13 | mkdir c:\mongodb\log | Out-Null 14 | 15 | 'systemLog: 16 | destination: file 17 | path: c:\mongodb\log\mongod.log 18 | storage: 19 | dbPath: c:\mongodb\data\db' | Out-File C:\mongodb\mongod.cfg -Encoding utf8 20 | 21 | Write-Host "Installing mongodb" 22 | cmd /c start /wait sc create MongoDB binPath= "C:\mongodb\bin\mongod.exe --service --config=C:\mongodb\mongod.cfg" DisplayName= "MongoDB" start= "demand" 23 | 24 | & c:\mongodb\bin\mongod --version 25 | 26 | Write-Host "Starting mongodb service" 27 | Start-Service mongodb 28 | Write-Host "Mongodb install complete." 29 | Write-Host "--------------------------------------" -------------------------------------------------------------------------------- /build/appveyor/set-connectionstrings.ps1: -------------------------------------------------------------------------------- 1 | $appVeyorConfig = "lib\Configs\connectionStrings.appveyor.config"; 2 | $destConfigPath = "lib\Configs\connectionStrings.dev.config"; 3 | 4 | Copy-Item -Path $appVeyorConfig -Destination $destConfigPath -Force 5 | 6 | Write-Host "Contents of lib\Configs\connectionStrings.dev.config :" 7 | Write-Host "------------------------------------------------------" 8 | Get-Content -Path "lib\Configs\connectionStrings.dev.config" 9 | Write-Host "------------------------------------------------------" 10 | 11 | Write-Host "Connection string setup complete." 12 | Write-Host "--------------------------------------" -------------------------------------------------------------------------------- /docs/azure.md: -------------------------------------------------------------------------------- 1 | # Azure website deployments 2 | If you have a Microsoft Azure account, you can deploy a new Roadkill wiki site very quickly using the website deployment option. 3 | 4 | ## Pre-requisites 5 | - You'll need a Githubaccount before you can use the deployment option in Azure. 6 | - You'll need to fork Roadkill on either Github or Bitbucket. You can do this via the website. You should fork the "v2.0" branch for stability, or "master" if you prefer the bleeding edge. 7 | 8 | ## Deployment steps: 9 | 1. Create a new website 10 | 2. Go to the "configure" page in the top menu 11 | 3. Navigate to the "app settings" section 12 | 4. Login using your Github details 13 | 5. Choose Roadkill from your list of repositories. 14 | 6. You will need to FTP (username/password is in the publish settings file) and download the roadkill.config file. Change the "installed=true" to "installed=false" in this file. 15 | This setting is true by default to avoid automatic deployments from showing their installer screen when a new commit is made to Roadkill. 16 | 17 | You will need to create a SQL or mySQL database in Azure too, copying the connection string details. -------------------------------------------------------------------------------- /docs/common-issues.md: -------------------------------------------------------------------------------- 1 | # Common issues 2 | 3 | ## Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 4 | 5 | Copy this DLL from app_data folder to the bin folder. 6 | 7 | ## Search doesn't return the latest pages 8 | Occasionally the Lucene index gets out of sync with the site from an error or other reason. This can also happen when a page is deleted - the whole index is updated when a page is created or deleted. If this happens you should login as the administrator for the site and head to Site settings->Tools and use the "Rebuild search index" option. 9 | 10 | This is the best thing to do for any search related problems, as it 99% of the time it will resolve the issue you're having. -------------------------------------------------------------------------------- /docs/custom-markup-tokens.md: -------------------------------------------------------------------------------- 1 | # Custom markup tokens 2 | You can add your own markup tokens that are replaced by editing the `~/App_Data/customvariables.xml` file. This file uses regular expressions to search and replace tokens for example `(youtube:someid)` is replaced with the HTML to display a youtube video. 3 | 4 | You will need to restart the application by making a web.config change for any new tokens to show. -------------------------------------------------------------------------------- /docs/importing-and-exporting.md: -------------------------------------------------------------------------------- 1 | # Importing and Exporting 2 | 3 | ## Importing 4 | Roadkill currently has one option for importing existing content, which is from a Screwturn 2/3 installation. Future versions of Roadkill will include a REST API for importing data, but for now this is the only import option. 5 | 6 | To import from a Screwturn database, you need to login as an administrator and head to the site settings->tools page. From here, enter your Screwturn database connection string (non-database installations aren't supported) and the tool will import the content including page history and categories into your Roadkill instance. 7 | 8 | ## Exporting 9 | Roadkill supports 4 types of exporting: 10 | 11 | - Exporting all content as a SQL file 12 | - Exporting pages and content as an XML file 13 | - Exporting all image/media uploads 14 | - Exporting each page as text (.wiki) file. 15 | 16 | You need to login as an administrator and head to the site settings->tools page to export. The last three export types will supply you with the content in .zip format, the .wiki text file export will include the page tags at the top of the file and then the content itself. -------------------------------------------------------------------------------- /docs/rest-api.md: -------------------------------------------------------------------------------- 1 | # REST API 2 | This is currently experimental and open to admins of the wiki only. 3 | 4 | To view the auto-generated documentation head to the /api url on your wiki -------------------------------------------------------------------------------- /docs/searching.md: -------------------------------------------------------------------------------- 1 | # Searching 2 | 3 | ## Introduction 4 | The Roadkill search engine is powered by Lucene.net. The index is updated each time a page is created or edited. Roadkill indexes the full content of the page along with the following fields: 5 | 6 | - id (the unique number each page is assigned) 7 | - content 8 | - title 9 | - tags 10 | - createdby (the username of the person who created the page) 11 | - createdon (the date the page was created) 12 | 13 | The search engine displays the first 150 characters of each page's content to display in the search summary. When you search in the textbox, the content field is searched by default. You can restrict the page to certain fields using the usual syntax found on search engines like as Google. For example: 14 | 15 | - title:"my page" 16 | - tags:dotnet, vb createdby:editor 17 | 18 | ## Index storage 19 | Lucene stores index files for its search data in the App_Data/Search folder. The worker process/application pool will have rights to read and write from this folder by default, so there shouldn't be any issues with permissions providing the website root folder permissions are setup correctly. 20 | 21 | The folder will contains 10 or more files in it, which Lucene may or may not contain file locks for while the site is running. -------------------------------------------------------------------------------- /docs/text-plugins-special-urls.md: -------------------------------------------------------------------------------- 1 | # Text and special: url plugins 2 | 3 | Documentation is pending for this topic, however you can find examples of writing plugins for pre and post-markdown/creole parsing, and adding your own `special:url` urls in the [example plugins repository](https://github.com/roadkillwiki/example-plugins). -------------------------------------------------------------------------------- /lib/Artwork/Logo/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/download.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/download.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/download.psd -------------------------------------------------------------------------------- /lib/Artwork/Logo/edosz.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/edosz.ttf -------------------------------------------------------------------------------- /lib/Artwork/Logo/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/favicon.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/installer.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/installer.psd -------------------------------------------------------------------------------- /lib/Artwork/Logo/roadkill-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/roadkill-large.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/roadkill-large.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/roadkill-large.psd -------------------------------------------------------------------------------- /lib/Artwork/Logo/roadkill-small.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/roadkill-small.psd -------------------------------------------------------------------------------- /lib/Artwork/Logo/roadkill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/roadkill.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/roadkill32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/roadkill32x32.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/screenshot1.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/screenshot2.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/screenshot3.png -------------------------------------------------------------------------------- /lib/Artwork/Logo/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/Logo/screenshot4.png -------------------------------------------------------------------------------- /lib/Artwork/roadkill-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Artwork/roadkill-large.png -------------------------------------------------------------------------------- /lib/Configs/Roadkill.dev.config: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /lib/Configs/Roadkill.download.config: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /lib/Configs/Roadkill.windowsauth-acceptance.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /lib/Configs/connectionStrings.appveyor.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/Configs/connectionStrings.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/Configs/connectionStrings.dev.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.Linq.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.MetaData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.MetaData.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.ServiceModel.DomainServices.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.ServiceModel.DomainServices.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.ServiceModel.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.ServiceModel.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.Web.DynamicData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.Web.DynamicData.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.Web.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.Web.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Mindscape.LightSpeed.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Mindscape.LightSpeed.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/AWSSDK.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/AWSSDK.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Commons.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Commons.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Lucene.Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Lucene.Net.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Memcached.ClientLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Memcached.ClientLibrary.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Microsoft.WindowsAzure.StorageClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Microsoft.WindowsAzure.StorageClient.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.AmazonSimpleDB.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.AmazonSimpleDB.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.DB2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.DB2.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.SqlServerCe35.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.SqlServerCe35.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.SqlServerCe4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.SqlServerCe4.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.VistaDB4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.VistaDB4.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.WindowsAzure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mindscape.LightSpeed.Providers.WindowsAzure.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Mono.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Mono.Security.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/MySql.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/MySql.Data.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Npgsql.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Npgsql.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/Oracle.DataAccess.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/Oracle.DataAccess.dll -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/System.Data.SQLite.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/System.Data.SQLite.DLL -------------------------------------------------------------------------------- /lib/LightSpeed/Providers/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/LightSpeed/Providers/log4net.dll -------------------------------------------------------------------------------- /lib/Microsoft.Web.Administration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Microsoft.Web.Administration.dll -------------------------------------------------------------------------------- /lib/Test-databases/Upgrade/roadkill152.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Test-databases/Upgrade/roadkill152.sdf -------------------------------------------------------------------------------- /lib/Test-databases/Upgrade/roadkill152.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Test-databases/Upgrade/roadkill152.sqlite -------------------------------------------------------------------------------- /lib/Test-databases/Upgrade/roadkill152.sqlserver.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/Test-databases/Upgrade/roadkill152.sqlserver.sql -------------------------------------------------------------------------------- /lib/Test-databases/readme.txt: -------------------------------------------------------------------------------- 1 | The database files in this folder all have schema and data in them, used for testing. 2 | 3 | SQL Server 2012 LocalDB is now used as the dev and acceptance test server - SQLCE won't be supported as of version 2.0. 4 | 5 | To get LocalDB working in a dev environment: 6 | 7 | - Open a command prompt 8 | - Type SqlLocalDB create Roadkill -s 9 | - Open SQL Server Management Studio 10 | - Connect to "(LocalDB)\Roadkill" 11 | - Open and execute the Roadkill-sqlserver-localdb.sql 12 | - Copy and replace the configs from the Lib/Configs folder into the Site root. 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /lib/WebPI/Manifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/WebPI/fciv.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/lib/WebPI/fciv.exe -------------------------------------------------------------------------------- /setup.ps1: -------------------------------------------------------------------------------- 1 | iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex 2 | choco install -y ruby 3 | choco install -y chromedriver 4 | 5 | echo "You will need to install MongoDb and Postgres for some tests." 6 | echo "The best way to do this is via Docker for Windows." 7 | echo "" 8 | echo "Docker requires Windows 10, build 10586 upwards." 9 | echo "You can install it by typing choco install docker." -------------------------------------------------------------------------------- /src/Roadkill.Core/Attachments/IResponseWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace Roadkill.Core.Attachments 2 | { 3 | /// 4 | /// Defines a class that wraps the HttpResponse object. 5 | /// 6 | public interface IResponseWrapper 7 | { 8 | void AddStatusCodeForCache(string fullPath, string modifiedSinceHeader); 9 | void BinaryWrite(byte[] buffer); 10 | string ContentType { get; set; } 11 | void End(); 12 | int StatusCode { get; set; } 13 | void Write(string text); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Cache/IPluginCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Roadkill.Core.Plugins; 3 | 4 | namespace Roadkill.Core.Cache 5 | { 6 | /// 7 | /// Defines a class that is capable of updating and retrieving cache plugin settings. 8 | /// 9 | public interface IPluginCache 10 | { 11 | /// 12 | /// Gets the plugin settings. 13 | /// 14 | /// The text plugin. 15 | /// Returns the or null if the plugin is not in the cache. 16 | Settings GetPluginSettings(TextPlugin plugin); 17 | 18 | /// 19 | /// Updates the plugin settings. 20 | /// 21 | /// The text plugin. 22 | void UpdatePluginSettings(TextPlugin plugin); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Entities/IDataStoreEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Roadkill.Core.Database 4 | { 5 | /// 6 | /// Defines a class that should be stored in the database or other kind of data store. 7 | /// 8 | public interface IDataStoreEntity 9 | { 10 | /// 11 | /// The unique id for this object - for use with document stores that require a unique id for storage. 12 | /// 13 | Guid ObjectId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Entities/SiteConfigurationEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Roadkill.Core.Configuration; 6 | 7 | namespace Roadkill.Core.Database 8 | { 9 | /// 10 | /// Represents settings that are stored as JSON in the database. This is used by the 11 | /// class and by plugin settings. 12 | /// 13 | public class SiteConfigurationEntity : IDataStoreEntity 14 | { 15 | /// 16 | /// Gets or sets the unique ID for the settings. 17 | /// 18 | /// 19 | /// The identifier. 20 | /// 21 | public Guid Id { get; set; } 22 | 23 | /// 24 | /// The jsonified version of the settings. 25 | /// 26 | public string Content { get; set; } 27 | 28 | /// 29 | /// A version for the settings, e.g. the Roadkill version. 30 | /// 31 | public string Version { get; set; } 32 | 33 | /// 34 | /// The unique id for this object, this is the same as the property. 35 | /// 36 | public Guid ObjectId 37 | { 38 | get { return Id; } 39 | set { Id = value; } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/IRepositoryFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Roadkill.Core.Database.Repositories; 3 | 4 | namespace Roadkill.Core.Database 5 | { 6 | public interface IRepositoryFactory 7 | { 8 | ISettingsRepository GetSettingsRepository(string databaseProviderName, string connectionString); 9 | IUserRepository GetUserRepository(string databaseProviderName, string connectionString); 10 | IPageRepository GetPageRepository(string databaseProviderName, string connectionString); 11 | 12 | IEnumerable ListAll(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/Dapper/IDbConnectionFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | 3 | namespace Roadkill.Core.Database.Repositories.Dapper 4 | { 5 | public interface IDbConnectionFactory 6 | { 7 | IDbConnection CreateConnection(); 8 | string GetAutoIdentitySqlSuffix(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/Dapper/PostgresConnectionFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using Npgsql; 3 | 4 | namespace Roadkill.Core.Database.Repositories.Dapper 5 | { 6 | public class PostgresConnectionFactory : IDbConnectionFactory 7 | { 8 | private readonly string _connectionString; 9 | 10 | public PostgresConnectionFactory(string connectionString) 11 | { 12 | _connectionString = connectionString; 13 | } 14 | 15 | public IDbConnection CreateConnection() 16 | { 17 | return new NpgsqlConnection(_connectionString); 18 | } 19 | 20 | public string GetAutoIdentitySqlSuffix() 21 | { 22 | return "RETURNING id"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/Dapper/SqlConnectionFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using System.Data.SqlClient; 3 | 4 | namespace Roadkill.Core.Database.Repositories.Dapper 5 | { 6 | public class SqlConnectionFactory : IDbConnectionFactory 7 | { 8 | private readonly string _connectionString; 9 | 10 | public SqlConnectionFactory(string connectionString) 11 | { 12 | _connectionString = connectionString; 13 | } 14 | 15 | public IDbConnection CreateConnection() 16 | { 17 | return new SqlConnection(_connectionString); 18 | } 19 | 20 | public string GetAutoIdentitySqlSuffix() 21 | { 22 | return ";select SCOPE_IDENTITY()"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/IDatabaseTester.cs: -------------------------------------------------------------------------------- 1 | using Mindscape.LightSpeed; 2 | 3 | namespace Roadkill.Core.Database 4 | { 5 | public interface IDatabaseTester 6 | { 7 | /// 8 | /// Tests a connection string for the database. This method should throw a if a 9 | /// database exception occurred. 10 | /// 11 | /// Can't connect to the server, or an invalid connection string 12 | void TestConnection(string databaseProvider, string connectionString); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/IInstallerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Roadkill.Core.Configuration; 3 | 4 | namespace Roadkill.Core.Database 5 | { 6 | public interface IInstallerRepository : IDisposable 7 | { 8 | void AddAdminUser(string email, string username, string password); 9 | void CreateSchema(); 10 | void SaveSettings(SiteSettings siteSettings); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/ISettingsRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Roadkill.Core.Configuration; 7 | using Roadkill.Core.Plugins; 8 | using PluginSettings = Roadkill.Core.Plugins.Settings; 9 | 10 | namespace Roadkill.Core.Database.Repositories 11 | { 12 | public interface ISettingsRepository : IDisposable 13 | { 14 | void SaveSiteSettings(SiteSettings siteSettings); 15 | SiteSettings GetSiteSettings(); 16 | void SaveTextPluginSettings(TextPlugin plugin); 17 | PluginSettings GetTextPluginSettings(Guid databaseId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Roadkill.Core.Converters; 5 | 6 | namespace Roadkill.Core.Database 7 | { 8 | public interface IUserRepository 9 | { 10 | void DeleteAllUsers(); 11 | void DeleteUser(User user); 12 | IEnumerable FindAllEditors(); 13 | IEnumerable FindAllAdmins(); 14 | User GetAdminById(Guid id); 15 | User GetUserByActivationKey(string key); 16 | User GetEditorById(Guid id); 17 | User GetUserByEmail(string email, bool? isActivated = null); 18 | User GetUserById(Guid id, bool? isActivated = null); 19 | User GetUserByPasswordResetKey(string key); 20 | User GetUserByUsername(string username); 21 | User GetUserByUsernameOrEmail(string username, string email); 22 | User SaveOrUpdateUser(User user); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/Lightspeed/DatabaseLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Mindscape.LightSpeed.Logging; 6 | using Roadkill.Core.Logging; 7 | 8 | namespace Roadkill.Core.Database.LightSpeed 9 | { 10 | public class DatabaseLogger : ILogger 11 | { 12 | public void LogDebug(object text) 13 | { 14 | Log.Debug(text.ToString()); 15 | } 16 | 17 | public void LogSql(object sql) 18 | { 19 | Log.Debug(sql.ToString()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Repositories/Lightspeed/SiteConfigurationEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mindscape.LightSpeed; 3 | using Roadkill.Core.Configuration; 4 | 5 | namespace Roadkill.Core.Database.LightSpeed 6 | { 7 | [Table("roadkill_siteconfiguration")] 8 | [Cached(ExpiryMinutes = 10)] 9 | public class SiteConfigurationEntity : Entity 10 | { 11 | [Column("content")] 12 | private string _content; 13 | 14 | [Column("version")] 15 | private string _version; 16 | 17 | public string Content 18 | { 19 | get 20 | { 21 | return _content; 22 | } 23 | set 24 | { 25 | Set(ref _content, value); 26 | } 27 | } 28 | 29 | 30 | public string Version 31 | { 32 | get 33 | { 34 | return _version; 35 | } 36 | set 37 | { 38 | Set(ref _version, value); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/MySql/Drop.sql: -------------------------------------------------------------------------------- 1 | SET FOREIGN_KEY_CHECKS = 0; 2 | DROP TABLE IF EXISTS roadkill_pages; 3 | DROP TABLE IF EXISTS roadkill_pagecontent; 4 | DROP TABLE IF EXISTS roadkill_users; 5 | DROP TABLE IF EXISTS roadkill_siteconfiguration; 6 | SET FOREIGN_KEY_CHECKS = 1; -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/MySql/MySqlSchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Database.Schema 7 | { 8 | public class MySqlSchema : SchemaBase 9 | { 10 | protected override IEnumerable GetCreateStatements() 11 | { 12 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.MySql.Create.sql"); 13 | return new string[] { sql }; 14 | } 15 | 16 | protected override IEnumerable GetDropStatements() 17 | { 18 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.MySql.Drop.sql"); 19 | return new string[] { sql }; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/Postgres/Create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE roadkill_pages 2 | ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | "tags" TEXT NOT NULL, 6 | "createdby" TEXT NOT NULL, 7 | "createdon" TIMESTAMP(20) WITHOUT TIME ZONE NOT NULL, 8 | "islocked" BOOLEAN NOT NULL, 9 | "modifiedby" TEXT, 10 | "modifiedon" TIMESTAMP(20) WITHOUT TIME ZONE, 11 | PRIMARY KEY("id") 12 | ); 13 | 14 | CREATE TABLE roadkill_pagecontent 15 | ( 16 | "id" UUID NOT NULL, 17 | "editedby" TEXT NOT NULL, 18 | "editedon" TIMESTAMP WITHOUT TIME ZONE NOT NULL, 19 | "versionnumber" INTEGER NOT NULL, 20 | "text" TEXT, 21 | "pageid" INTEGER NOT NULL, 22 | PRIMARY KEY("id") 23 | ); 24 | 25 | CREATE TABLE roadkill_users 26 | ( 27 | "id" UUID NOT NULL, 28 | "activationkey" TEXT, 29 | "email" TEXT NOT NULL, 30 | "firstname" TEXT, 31 | "lastname" TEXT, 32 | "iseditor" BOOLEAN NOT NULL, 33 | "isadmin" BOOLEAN NOT NULL, 34 | "isactivated" BOOLEAN NOT NULL, 35 | "password" TEXT NOT NULL, 36 | "passwordresetkey" TEXT, 37 | "salt" TEXT NOT NULL, 38 | "username" TEXT NOT NULL, 39 | PRIMARY KEY("id") 40 | ); 41 | 42 | CREATE TABLE roadkill_siteconfiguration 43 | ( 44 | "id" UUID NOT NULL, 45 | "version" TEXT NOT NULL, 46 | "content" TEXT NOT NULL UNIQUE, 47 | PRIMARY KEY("id") 48 | ); -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/Postgres/Drop.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS roadkill_pages; 2 | DROP TABLE IF EXISTS roadkill_pagecontent; 3 | DROP TABLE IF EXISTS roadkill_users; 4 | DROP TABLE IF EXISTS roadkill_siteconfiguration; -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/Postgres/PostgresSchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Database.Schema 7 | { 8 | public class PostgresSchema : SchemaBase 9 | { 10 | protected override IEnumerable GetCreateStatements() 11 | { 12 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.Postgres.Create.sql"); 13 | return new string[] { sql }; 14 | } 15 | 16 | protected override IEnumerable GetDropStatements() 17 | { 18 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.Postgres.Drop.sql"); 19 | return new string[] { sql }; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/SqlServer/Drop.sql: -------------------------------------------------------------------------------- 1 | IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[roadkill_pagecontent_fk_pageid]') AND parent_object_id = OBJECT_ID(N'[dbo].[roadkill_pagecontent]')) 2 | ALTER TABLE [dbo].[roadkill_pagecontent] DROP CONSTRAINT [FK_roadkill_pageid]; 3 | 4 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[roadkill_pagecontent]') AND type in (N'U')) 5 | DROP TABLE [dbo].[roadkill_pagecontent]; 6 | 7 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[roadkill_pages]') AND type in (N'U')) 8 | DROP TABLE [dbo].[roadkill_pages]; 9 | 10 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[roadkill_users]') AND type in (N'U')) 11 | DROP TABLE [dbo].[roadkill_users]; 12 | 13 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[roadkill_siteconfiguration]') AND type in (N'U')) 14 | DROP TABLE [dbo].[roadkill_siteconfiguration]; -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/Schema/SqlServer/SqlServerSchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Database.Schema 7 | { 8 | public class SqlServerSchema : SchemaBase 9 | { 10 | protected override IEnumerable GetCreateStatements() 11 | { 12 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.SqlServer.Create.sql"); 13 | return new string[] { sql }; 14 | } 15 | 16 | protected override IEnumerable GetDropStatements() 17 | { 18 | string sql = LoadFromResource("Roadkill.Core.Database.Schema.SqlServer.Drop.sql"); 19 | return new string[] { sql }; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Database/SupportedDatabases.cs: -------------------------------------------------------------------------------- 1 | namespace Roadkill.Core.Database 2 | { 3 | public class SupportedDatabases 4 | { 5 | public static readonly RepositoryInfo MongoDB = new RepositoryInfo("MongoDB", "MongoDB - A MongoDB server, using the official MongoDB driver."); 6 | public static readonly RepositoryInfo MySQL = new RepositoryInfo("MySQL", "MySQL"); 7 | public static readonly RepositoryInfo Postgres = new RepositoryInfo("Postgres", "Postgres - A Postgres 9 or later database."); 8 | public static readonly RepositoryInfo SqlServer2008 = new RepositoryInfo("SqlServer2008", "Sql Server - a SqlServer 2008 or later database."); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/DependencyResolution/ISetterInjected.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Configuration; 2 | using Roadkill.Core.Security; 3 | using Roadkill.Core.Services; 4 | 5 | namespace Roadkill.Core.DependencyResolution 6 | { 7 | /// 8 | /// Defines an class that has is created and has its property values setter injected by Structuremap. 9 | /// 10 | public interface ISetterInjected 11 | { 12 | ApplicationSettings ApplicationSettings { get; set; } 13 | IUserContext Context { get; set; } 14 | UserServiceBase UserService { get; set; } 15 | IPageService PageService { get; set; } 16 | SettingsService SettingsService { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/DependencyResolution/MVC/MvcModelBinders.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Mvc; 3 | using Roadkill.Core.Mvc.ViewModels; 4 | using StructureMap; 5 | 6 | namespace Roadkill.Core.DependencyResolution.MVC 7 | { 8 | /// 9 | /// Used by the MVC framework to create all instances of a view model object. 10 | /// 11 | internal class UserViewModelModelBinder : DefaultModelBinder 12 | { 13 | protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType) 14 | { 15 | return LocatorStartup.Locator.GetInstance(); 16 | } 17 | } 18 | 19 | /// 20 | /// Used by the MVC framework to create all instances of a view model object. 21 | /// 22 | internal class SettingsViewModelBinder : DefaultModelBinder 23 | { 24 | protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType) 25 | { 26 | return LocatorStartup.Locator.GetInstance(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Roadkill.Core/DependencyResolution/StructureMap/LightSpeedRegistry.cs: -------------------------------------------------------------------------------- 1 | using Mindscape.LightSpeed; 2 | using Roadkill.Core.Database; 3 | using StructureMap; 4 | using StructureMap.Web; 5 | 6 | namespace Roadkill.Core.DependencyResolution.StructureMap 7 | { 8 | public class LightSpeedRegistry : Registry 9 | { 10 | public LightSpeedRegistry() 11 | { 12 | For().Use("LightSpeedContext", x => 13 | { 14 | var factory = x.TryGetInstance() as RepositoryFactory; 15 | 16 | if (factory == null) 17 | return null; 18 | 19 | return factory.Context; 20 | }); 21 | 22 | For() 23 | .HybridHttpOrThreadLocalScoped() 24 | .Use(x => x.GetInstance().CreateUnitOfWork()); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/DependencyResolution/StructureMap/StructureMapHttpModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web; 3 | using StructureMap.Web.Pipeline; 4 | 5 | namespace Roadkill.Core.DependencyResolution.StructureMap 6 | { 7 | public class StructureMapHttpModule : IHttpModule 8 | { 9 | public void Dispose() 10 | { 11 | } 12 | 13 | public void Init(HttpApplication context) 14 | { 15 | context.BeginRequest += (sender, e) => LocatorStartup.Locator.CreateNestedContainer(); 16 | context.EndRequest += (sender, e) => 17 | { 18 | try 19 | { 20 | HttpContextLifecycle.DisposeAndClearAll(); 21 | LocatorStartup.Locator.DisposeNestedContainer(); 22 | } 23 | catch (InvalidOperationException) 24 | { 25 | // Catch HttpContextLifecycle.DisposeAndClearAll(); issues 26 | } 27 | }; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Email/EmailClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Mail; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Roadkill.Core.Email 9 | { 10 | public class EmailClient : IEmailClient 11 | { 12 | private SmtpClient _smtpClient; 13 | public string PickupDirectoryLocation { get; set; } 14 | 15 | public EmailClient() 16 | { 17 | _smtpClient = new SmtpClient(); 18 | 19 | // Default it to the SmtpClient's settings, which are read from a .config 20 | PickupDirectoryLocation = _smtpClient.PickupDirectoryLocation; 21 | } 22 | 23 | public void Send(MailMessage message) 24 | { 25 | _smtpClient.PickupDirectoryLocation = PickupDirectoryLocation; 26 | _smtpClient.Send(message); 27 | } 28 | 29 | public SmtpDeliveryMethod GetDeliveryMethod() 30 | { 31 | return _smtpClient.DeliveryMethod; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Email/IEmailClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Mail; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Roadkill.Core.Email 9 | { 10 | /// 11 | /// 12 | /// 13 | public interface IEmailClient 14 | { 15 | string PickupDirectoryLocation { get; set; } 16 | void Send(MailMessage message); 17 | SmtpDeliveryMethod GetDeliveryMethod(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Email/ResetPasswordEmail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | using System.Web; 7 | using System.Globalization; 8 | using Roadkill.Core.Configuration; 9 | using Roadkill.Core.Mvc.ViewModels; 10 | using Roadkill.Core.Database; 11 | using Roadkill.Core.Database.Repositories; 12 | 13 | namespace Roadkill.Core.Email 14 | { 15 | /// 16 | /// The template for password reset emails. 17 | /// 18 | public class ResetPasswordEmail : EmailTemplate 19 | { 20 | private static string _htmlContent; 21 | private static string _plainTextContent; 22 | 23 | public ResetPasswordEmail(ApplicationSettings applicationSettings, ISettingsRepository settingsRepository, IEmailClient emailClient) 24 | : base(applicationSettings, settingsRepository, emailClient) 25 | { 26 | } 27 | 28 | public override void Send(UserViewModel model) 29 | { 30 | // Thread safety should not be an issue here 31 | if (string.IsNullOrEmpty(_plainTextContent)) 32 | _plainTextContent = ReadTemplateFile("ResetPassword.txt"); 33 | 34 | if (string.IsNullOrEmpty(_htmlContent)) 35 | _htmlContent = ReadTemplateFile("ResetPassword.html"); 36 | 37 | PlainTextView = _plainTextContent; 38 | HtmlView = _htmlContent; 39 | 40 | base.Send(model); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Email/SignupEmail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | using System.Web; 7 | using System.Globalization; 8 | using Roadkill.Core.Configuration; 9 | using Roadkill.Core.Mvc.ViewModels; 10 | using Roadkill.Core.Database; 11 | using Roadkill.Core.Database.Repositories; 12 | 13 | namespace Roadkill.Core.Email 14 | { 15 | /// 16 | /// The template for signup emails. 17 | /// 18 | public class SignupEmail : EmailTemplate 19 | { 20 | private static string _htmlContent; 21 | private static string _plainTextContent; 22 | 23 | public SignupEmail(ApplicationSettings applicationSettings, ISettingsRepository settingsRepository, IEmailClient emailClient) 24 | : base(applicationSettings, settingsRepository, emailClient) 25 | { 26 | } 27 | 28 | public override void Send(UserViewModel model) 29 | { 30 | // Thread safety should not be an issue here 31 | if (string.IsNullOrEmpty(_plainTextContent)) 32 | _plainTextContent = ReadTemplateFile("Signup.txt"); 33 | 34 | if (string.IsNullOrEmpty(_htmlContent)) 35 | _htmlContent = ReadTemplateFile("Signup.html"); 36 | 37 | PlainTextView = _plainTextContent; 38 | HtmlView = _htmlContent; 39 | 40 | base.Send(model); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/ConfigurationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when an error occurs with the Roadkill configuration. 10 | /// 11 | public class ConfigurationException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public ConfigurationException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public ConfigurationException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/DatabaseException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when a database task does not complete correctly. 10 | /// 11 | public class DatabaseException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public DatabaseException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public DatabaseException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/EmailException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when sending an email fails.. 10 | /// 11 | public class EmailException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public EmailException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public EmailException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/FileException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Roadkill.Core.Exceptions 4 | { 5 | class FileException : ExceptionBase 6 | { 7 | /// 8 | /// Initializes a new instance of the class. 9 | /// 10 | /// The exception message. 11 | /// The inner exception. 12 | public FileException(string message, Exception inner) : base(message, inner) { } 13 | 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The inner exception. 18 | /// The message as an string. 19 | /// Arguments for the message format. 20 | public FileException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/HistoryException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when a page history related task does not complete correctly. 10 | /// 11 | public class HistoryException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public HistoryException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public HistoryException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/InstallerException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when an installation task fails. 10 | /// 11 | public class InstallerException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public InstallerException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public InstallerException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/IoCException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when an IoC related task does not complete correctly. 10 | /// 11 | public class IoCException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public IoCException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public IoCException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/PluginException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when an error occurs with a plugin. 10 | /// 11 | public class PluginException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public PluginException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public PluginException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/SearchException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when a search related task does not complete correctly. 10 | /// 11 | public class SearchException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public SearchException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public SearchException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Exceptions/SecurityException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core 7 | { 8 | /// 9 | /// The exception that is thrown when a task for a user/role does not complete correctly. 10 | /// 11 | public class SecurityException : ExceptionBase 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The exception message. 17 | /// The inner exception. 18 | public SecurityException(string message, Exception inner) : base(message, inner) { } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The inner exception. 24 | /// The message as an string. 25 | /// Arguments for the message format. 26 | public SecurityException(Exception inner, string message, params object[] args) : base(string.Format(message, args), inner) { } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Import/IWikiImporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Roadkill.Core.Services; 6 | 7 | namespace Roadkill.Core.Import 8 | { 9 | /// 10 | /// Represents a class that can import page data from a database source. 11 | /// 12 | public interface IWikiImporter 13 | { 14 | /// 15 | /// Imports page data from a database using the provided connection string. 16 | /// 17 | /// The database connection string. 18 | void ImportFromSqlServer(string connectionString); 19 | 20 | /// 21 | /// Updates the search index after a successful import. 22 | /// 23 | /// The search manager to use for the update. 24 | void UpdateSearchIndex(SearchService searchService); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Import/MatchComparer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Roadkill.Core.Import 5 | { 6 | class MatchComparer : IEqualityComparer 7 | { 8 | public bool Equals(Match a, Match b) 9 | { 10 | return a.Value == b.Value; 11 | } 12 | 13 | public int GetHashCode(Match match) 14 | { 15 | return match.Value.GetHashCode(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Logging/Level.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Logging 7 | { 8 | /// 9 | /// The severity of a log message. 10 | /// 11 | public enum Level 12 | { 13 | /// 14 | /// A debug message, such as a sql statement. 15 | /// 16 | Debug, 17 | /// 18 | /// Information message, such as a cache hit. 19 | /// 20 | Information, 21 | /// 22 | /// A warning log message for when something has failed unexpectedly. 23 | /// 24 | Warning, 25 | /// 26 | /// An error log message, for an unexpected message. 27 | /// 28 | Error 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Attributes/CacheContentTypeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | using System.Web.UI; 8 | using Roadkill.Core.Configuration; 9 | using Roadkill.Core.Mvc.Controllers; 10 | using Roadkill.Core.Services; 11 | using Roadkill.Core.Security; 12 | using StructureMap; 13 | using StructureMap.Attributes; 14 | using Roadkill.Core.Mvc.ViewModels; 15 | using Roadkill.Core.Attachments; 16 | 17 | namespace Roadkill.Core.Mvc.Attributes 18 | { 19 | /// 20 | /// Over-rides the OutputCache so it doesn't force text/html 21 | /// 22 | public class CacheContentTypeAttribute : OutputCacheAttribute 23 | { 24 | public string ContentType { get; set; } 25 | 26 | public override void OnResultExecuted(ResultExecutedContext filterContext) 27 | { 28 | base.OnResultExecuted(filterContext); 29 | 30 | ContentType = ContentType ?? "text/html"; 31 | filterContext.HttpContext.Response.ContentType = ContentType; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Attributes/ExportModelStateAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | 7 | namespace Roadkill.Core.Mvc.Attributes 8 | { 9 | /// 10 | /// Represents an attribute that is used to maintain the ModelState when performing a RedirectToAction(). 11 | /// 12 | public class ExportModelStateAttribute : ActionFilterAttribute 13 | { 14 | protected static readonly string _key = "MODELSTATE_TEMPDATA"; 15 | 16 | public override void OnActionExecuted(ActionExecutedContext filterContext) 17 | { 18 | // Based on: http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx#prg 19 | // Only export when ModelState is not valid 20 | if (!filterContext.Controller.ViewData.ModelState.IsValid) 21 | { 22 | // Export if we are redirecting 23 | if ((filterContext.Result is RedirectResult) || (filterContext.Result is RedirectToRouteResult)) 24 | { 25 | filterContext.Controller.TempData[_key] = filterContext.Controller.ViewData.ModelState; 26 | } 27 | } 28 | 29 | base.OnActionExecuted(filterContext); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Attributes/IAuthorizationAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Roadkill.Core.Security; 7 | 8 | namespace Roadkill.Core.Mvc.Attributes 9 | { 10 | public interface IAuthorizationAttribute 11 | { 12 | IAuthorizationProvider AuthorizationProvider { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Attributes/ImportModelStateAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | 7 | namespace Roadkill.Core.Mvc.Attributes 8 | { 9 | /// 10 | /// Represents an attribute that is used to import a ModelState from an action that has performed a RedirectToAction(). 11 | /// That action should be decorated with the . 12 | /// 13 | public class ImportModelStateAttribute : ActionFilterAttribute 14 | { 15 | protected static readonly string _key = "MODELSTATE_TEMPDATA"; 16 | 17 | public override void OnActionExecuted(ActionExecutedContext filterContext) 18 | { 19 | // Based on: http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx#prg 20 | ModelStateDictionary modelState = filterContext.Controller.TempData[_key] as ModelStateDictionary; 21 | 22 | if (modelState != null) 23 | { 24 | // Only Import if we are viewing 25 | if (filterContext.Result is ViewResult) 26 | { 27 | filterContext.Controller.ViewData.ModelState.Merge(modelState); 28 | } 29 | else 30 | { 31 | // Otherwise remove it. 32 | filterContext.Controller.TempData.Remove(_key); 33 | } 34 | } 35 | 36 | base.OnActionExecuted(filterContext); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Controllers/IRoadkillController.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Configuration; 2 | using Roadkill.Core.Security; 3 | using Roadkill.Core.Services; 4 | 5 | namespace Roadkill.Core.Mvc.Controllers 6 | { 7 | public interface IRoadkillController 8 | { 9 | ApplicationSettings ApplicationSettings { get; } 10 | UserServiceBase UserService { get; } 11 | IUserContext Context { get; } 12 | SettingsService SettingsService { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Controllers/SiteSettings/SiteSettingsAreaRegistration.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | 4 | namespace Roadkill.Core.Mvc.Controllers 5 | { 6 | public class SiteSettingsAreaRegistration : AreaRegistration 7 | { 8 | public override string AreaName 9 | { 10 | get 11 | { 12 | return "SiteSettings"; 13 | } 14 | } 15 | 16 | public override void RegisterArea(AreaRegistrationContext context) 17 | { 18 | // "/Settings" (used by the view routing as the controller is called Settings) 19 | context.MapRoute( 20 | "SiteSettings_Default", 21 | "Settings", 22 | new { controller = "Settings", action = "Index", id = UrlParameter.Optional }); 23 | 24 | // "/SiteSettings/{controller}/{action}/{id}" 25 | context.MapRoute( 26 | "SiteSettings_Controller", 27 | "SiteSettings/{controller}/{action}/{id}", 28 | new { controller = "Settings", action = "Index", id = UrlParameter.Optional } 29 | ); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/Setup/ExtendedRazorViewEngine.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Web.Mvc; 3 | 4 | namespace Roadkill.Core.Mvc.Setup 5 | { 6 | public class ExtendedRazorViewEngine : RazorViewEngine 7 | { 8 | public static void Register() 9 | { 10 | // Add a search path for /Dialogs, /Plugins/SpecialPages via a custom view engine. 11 | ViewEngines.Engines.Clear(); 12 | 13 | // {1} is the controller, {0} is the action 14 | ExtendedRazorViewEngine engine = new ExtendedRazorViewEngine(); 15 | engine.AddPartialViewLocationFormat("~/Views/Shared/Dialogs/{0}.cshtml"); 16 | engine.AddViewLocationFormat("~/Plugins/{0}.cshtml"); 17 | engine.AddPartialViewLocationFormat("~/Plugins/{0}.cshtml"); 18 | 19 | ViewEngines.Engines.Add(engine); 20 | } 21 | 22 | public void AddViewLocationFormat(string paths) 23 | { 24 | List existingPaths = new List(ViewLocationFormats); 25 | existingPaths.Add(paths); 26 | 27 | ViewLocationFormats = existingPaths.ToArray(); 28 | } 29 | 30 | public void AddPartialViewLocationFormat(string paths) 31 | { 32 | List existingPaths = new List(PartialViewLocationFormats); 33 | existingPaths.Add(paths); 34 | 35 | PartialViewLocationFormats = existingPaths.ToArray(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/ViewModels/CacheViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Roadkill.Core.Mvc.ViewModels 8 | { 9 | public class CacheViewModel 10 | { 11 | public IEnumerable PageKeys { get; set; } 12 | public IEnumerable ListKeys { get; set; } 13 | public IEnumerable SiteKeys { get; set; } 14 | public bool IsCacheEnabled { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/ViewModels/FileViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using Roadkill.Core.Configuration; 7 | 8 | namespace Roadkill.Core.Mvc.ViewModels 9 | { 10 | /// 11 | /// A single file in a folder in the attachments folder. 12 | /// 13 | public class FileViewModel 14 | { 15 | public string Name { get; set; } 16 | public string Path { get; set; } 17 | public string Extension { get; set; } 18 | public long Size { get; set; } 19 | public string CreateDate { get; set; } 20 | public string Folder { get; set; } 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The relative path of the filename 26 | public FileViewModel(string name, string extension, long size, DateTime createDate, string folder) 27 | { 28 | Name = name; 29 | Extension = extension; 30 | Size = size; 31 | CreateDate = createDate.ToShortDateString(); 32 | Folder = folder; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/ViewModels/LanguageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Mvc.ViewModels 7 | { 8 | public class LanguageViewModel 9 | { 10 | public string Code { get; set; } 11 | public string Name { get; set; } 12 | 13 | public LanguageViewModel(string code, string name) 14 | { 15 | Code = code; 16 | Name = name; 17 | } 18 | 19 | public static IEnumerable SupportedLocales() 20 | { 21 | List languages = new List() 22 | { 23 | new LanguageViewModel("en", "English"), 24 | new LanguageViewModel("ca", "Català"), 25 | new LanguageViewModel("cs", "Čeština"), 26 | new LanguageViewModel("de", "Deutsch"), 27 | new LanguageViewModel("nl", "Dutch"), 28 | new LanguageViewModel("es", "Español"), 29 | new LanguageViewModel("it", "Italiano"), 30 | new LanguageViewModel("hi", "हिंदी"), 31 | new LanguageViewModel("pl", "Polski"), 32 | new LanguageViewModel("pt", "Português"), 33 | new LanguageViewModel("ru", "Pусский"), 34 | new LanguageViewModel("sv", "Svensk"), 35 | }; 36 | 37 | return languages; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/ViewModels/TestResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Roadkill.Core.Mvc.ViewModels 8 | { 9 | /// 10 | /// Basic error information for the JSON actions 11 | /// 12 | public class TestResult 13 | { 14 | /// 15 | /// Any error message associated with the call. 16 | /// 17 | public string ErrorMessage { get; set; } 18 | 19 | /// 20 | /// Indicates if there are any errors. 21 | /// 22 | public bool Success 23 | { 24 | get { return string.IsNullOrEmpty(ErrorMessage); } 25 | } 26 | 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The error message. 31 | public TestResult(string errorMessage) 32 | { 33 | ErrorMessage = errorMessage; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/WebApi/ApiKeyAuthorizeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Net; 3 | using System.Net.Http; 4 | using System.Web.Http; 5 | using System.Web.Http.Controllers; 6 | using Roadkill.Core.Configuration; 7 | using StructureMap.Attributes; 8 | 9 | namespace Roadkill.Core.Mvc.WebApi 10 | { 11 | public class ApiKeyAuthorizeAttribute : AuthorizeAttribute 12 | { 13 | [SetterProperty] 14 | public ApplicationSettings ApplicationSettings { get; set; } 15 | 16 | public static readonly string APIKEY_HEADER_KEY = "Authorization"; 17 | 18 | public override void OnAuthorization(HttpActionContext actionContext) 19 | { 20 | if (!actionContext.Request.Headers.Contains(APIKEY_HEADER_KEY)) 21 | { 22 | actionContext.Response = new HttpResponseMessage(HttpStatusCode.BadRequest); 23 | return; 24 | } 25 | 26 | string keyValue = actionContext.Request.Headers.GetValues(APIKEY_HEADER_KEY).First(); 27 | 28 | if (!ApplicationSettings.ApiKeys.Contains(keyValue)) 29 | actionContext.Response = new HttpResponseMessage(HttpStatusCode.Unauthorized); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/WebViewPages/RoadkillLayoutPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | using Roadkill.Core.Configuration; 7 | using Roadkill.Core.Converters; 8 | using Roadkill.Core.DependencyResolution; 9 | using Roadkill.Core.Services; 10 | using StructureMap; 11 | using StructureMap.Attributes; 12 | 13 | namespace Roadkill.Core.Mvc.WebViewPages 14 | { 15 | // Layout pages aren't created using IDependencyResolver (as they're outside of MVC). So use bastard injection for them. 16 | public abstract class RoadkillLayoutPage : WebViewPage 17 | { 18 | public ApplicationSettings ApplicationSettings { get; set; } 19 | public IUserContext RoadkillContext { get; set; } 20 | public MarkupConverter MarkupConverter { get; set; } 21 | public SiteSettings SiteSettings { get; set; } 22 | 23 | public RoadkillLayoutPage() 24 | { 25 | ApplicationSettings = LocatorStartup.Locator.GetInstance(); 26 | RoadkillContext = LocatorStartup.Locator.GetInstance(); 27 | 28 | if (ApplicationSettings.Installed) 29 | { 30 | MarkupConverter = LocatorStartup.Locator.GetInstance(); 31 | SiteSettings = LocatorStartup.Locator.GetInstance().GetSiteSettings(); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Mvc/WebViewPages/RoadkillViewPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | using Roadkill.Core.Configuration; 7 | using Roadkill.Core.Converters; 8 | using Roadkill.Core.Services; 9 | using StructureMap; 10 | using StructureMap.Attributes; 11 | 12 | namespace Roadkill.Core.Mvc.WebViewPages 13 | { 14 | public abstract class RoadkillViewPage : WebViewPage 15 | { 16 | // Constructor injection isn't viable here, as this class is created by the ASP.NET runtime 17 | private SiteSettings _siteSettings; 18 | 19 | [SetterProperty] 20 | public ApplicationSettings ApplicationSettings { get; set; } 21 | 22 | [SetterProperty] 23 | public IUserContext RoadkillContext { get; set; } 24 | 25 | [SetterProperty] 26 | public MarkupConverter MarkupConverter { get; set; } 27 | 28 | [SetterProperty] 29 | public SettingsService SettingsService { get; set; } 30 | 31 | public SiteSettings SiteSettings 32 | { 33 | get 34 | { 35 | if (_siteSettings == null) 36 | _siteSettings = SettingsService.GetSiteSettings(); 37 | 38 | return _siteSettings; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Owin/InstallCheckMiddleware.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Owin; 4 | using Roadkill.Core.Configuration; 5 | 6 | namespace Roadkill.Core.Owin 7 | { 8 | public class InstallCheckMiddleware : OwinMiddleware 9 | { 10 | private readonly ApplicationSettings _appSettings; 11 | 12 | public InstallCheckMiddleware(OwinMiddleware next, ApplicationSettings appSettings) : base(next) 13 | { 14 | _appSettings = appSettings; 15 | } 16 | 17 | public override async Task Invoke(IOwinContext context) 18 | { 19 | var appSettings = _appSettings; 20 | if (appSettings.Installed == false && IsOnInstallPage(context) == false && IsHtmlRequest(context)) 21 | { 22 | context.Response.Redirect("/Install/"); 23 | } 24 | else 25 | { 26 | await Next.Invoke(context); 27 | } 28 | } 29 | 30 | private static bool IsHtmlRequest(IOwinContext context) 31 | { 32 | return !string.IsNullOrEmpty(context.Request.Accept) && context.Request.Accept.Contains("text/html"); 33 | } 34 | 35 | private bool IsOnInstallPage(IOwinContext context) 36 | { 37 | return context.Request.Uri.PathAndQuery.StartsWith("/Install/", StringComparison.InvariantCultureIgnoreCase); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Plugins/IPluginFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Roadkill.Core.Configuration; 4 | 5 | namespace Roadkill.Core.Plugins 6 | { 7 | /// 8 | /// Manage all plugin instances in Roadkill. 9 | /// 10 | public interface IPluginFactory 11 | { 12 | /// 13 | /// Retrieves all text plugins from the DI container. 14 | /// 15 | IEnumerable GetTextPlugins(); 16 | 17 | /// 18 | /// Retrieves all text plugins with their Settings.IsEnabled set to true, from the IoC container. 19 | /// 20 | IEnumerable GetEnabledTextPlugins(); 21 | 22 | /// 23 | /// Allows additional text plugins to be registered at runtime. 24 | /// 25 | void RegisterTextPlugin(TextPlugin plugin); 26 | 27 | /// 28 | /// Case insensitive search for a text plugin. Returns null if it doesn't exist. 29 | /// 30 | TextPlugin GetTextPlugin(string id); 31 | 32 | /// 33 | /// Gets all SpecialPage plugins registered in the DI container. 34 | /// 35 | IEnumerable GetSpecialPagePlugins(); 36 | 37 | /// 38 | /// Case insensitive search for a special page plugin. Returns null if it doesn't exist. 39 | /// 40 | SpecialPagePlugin GetSpecialPagePlugin(string name); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Plugins/SettingFormType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Plugins 7 | { 8 | /// 9 | /// Defines the the UI representation that a setting should have. 10 | /// 11 | public enum SettingFormType 12 | { 13 | /// 14 | /// A textbox. 15 | /// 16 | Textbox = 0, 17 | /// 18 | /// A checkbox. 19 | /// 20 | Checkbox = 1, 21 | /// 22 | /// A textarea. 23 | /// 24 | Textarea = 2, 25 | /// 26 | /// A password box. 27 | /// 28 | Password = 3 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/FormsAuthenticationWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Security; 6 | 7 | namespace Roadkill.Core.Security 8 | { 9 | /// 10 | /// Used to wrap FormsAuthentication methods, where Mono does not implement the methods or 11 | /// behaves slightly differently from the Windows implementation. 12 | /// 13 | public class FormsAuthenticationWrapper 14 | { 15 | public static bool IsEnabled() 16 | { 17 | #if MONO 18 | return true; // Mono doesn't support FormsAuthentication 19 | #else 20 | return FormsAuthentication.IsEnabled; 21 | #endif 22 | } 23 | 24 | public static string CookieName() 25 | { 26 | #if MONO 27 | if (!string.IsNullOrEmpty(FormsAuthentication.FormsCookieName)) 28 | return FormsAuthentication.FormsCookieName; 29 | else 30 | return ""; 31 | #else 32 | return FormsAuthentication.FormsCookieName; 33 | #endif 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/IAuthorizationProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Principal; 3 | 4 | namespace Roadkill.Core.Security 5 | { 6 | public interface IAuthorizationProvider 7 | { 8 | bool IsAdmin(IPrincipal principal); 9 | bool IsEditor(IPrincipal principal); 10 | bool IsViewer(IPrincipal principal); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/IUserContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Roadkill.Core.Mvc.ViewModels; 3 | 4 | namespace Roadkill.Core 5 | { 6 | /// 7 | /// Defines a class that holds information for the current logged in user, and the current page. 8 | /// 9 | public interface IUserContext 10 | { 11 | /// 12 | /// The current logged in user - for example this can be an ID for forms authentication or 13 | /// a fully qualified domain name and username for Windows Authentication. 14 | /// 15 | string CurrentUser { get; set; } 16 | 17 | /// 18 | /// The username for the logged in user, retrieved by looking up the ID stored by the CurrentUser property. 19 | /// 20 | string CurrentUsername { get; } 21 | 22 | /// 23 | /// Gets whether the user (if logged in), is in the editors group. 24 | /// 25 | bool IsAdmin { get; } 26 | 27 | /// 28 | /// Gets whether the user (if logged in), is in the editors group. 29 | /// 30 | bool IsEditor { get; } 31 | 32 | /// 33 | /// Gets whether the request is for a logged in user. 34 | /// 35 | bool IsLoggedIn { get; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/Salt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Security 7 | { 8 | /// 9 | /// Generates a random 16 character string for a hashed password salt. 10 | /// 11 | /// 12 | /// password login: 13 | /// C1CD20DA5452C0D370794759CD151058AC189F2C 14 | /// 1234567890 15 | /// 16 | public class Salt 17 | { 18 | private static Random _random = new Random(); 19 | 20 | /// 21 | /// The salt value. 22 | /// 23 | public string Value { get; private set; } 24 | 25 | /// 26 | /// Initializes a new instance of the class, generating a new salt value. 27 | /// 28 | public Salt() 29 | { 30 | StringBuilder builder = new StringBuilder(16); 31 | for (int i = 0; i < 16; i++) 32 | { 33 | builder.Append((char)_random.Next(33, 126)); 34 | } 35 | 36 | Value = builder.ToString(); 37 | } 38 | 39 | public static implicit operator string(Salt salt) 40 | { 41 | return salt.Value; 42 | } 43 | 44 | public override string ToString() 45 | { 46 | return Value; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/Windows/IActiveDirectoryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.DirectoryServices.AccountManagement; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace Roadkill.Core.Security.Windows 8 | { 9 | /// 10 | /// Provides group membership lookup for the 11 | /// 12 | public interface IActiveDirectoryProvider 13 | { 14 | IEnumerable GetMembers(string domainName, string username, string password, string groupName); 15 | string TestLdapConnection(string connectionString, string username, string password, string groupName); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/Windows/IPrincipalDetails.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.DirectoryServices.AccountManagement; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace Roadkill.Core.Security.Windows 8 | { 9 | /// 10 | /// Wraps information needed from an 11 | /// 12 | public interface IPrincipalDetails 13 | { 14 | string SamAccountName { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Security/Windows/PrincipalDetails.cs: -------------------------------------------------------------------------------- 1 | #if !MONO 2 | using System; 3 | using System.Collections.Generic; 4 | using System.DirectoryServices.AccountManagement; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace Roadkill.Core.Security.Windows 9 | { 10 | public class PrincipalDetails : IPrincipalDetails 11 | { 12 | public string SamAccountName { get; set; } 13 | 14 | public PrincipalDetails(UserPrincipal principal) 15 | { 16 | SamAccountName = principal.SamAccountName; 17 | } 18 | } 19 | } 20 | #endif -------------------------------------------------------------------------------- /src/Roadkill.Core/Services/IFileService.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Attachments; 2 | using Roadkill.Core.Mvc.ViewModels; 3 | using System.Web; 4 | 5 | namespace Roadkill.Core.Services 6 | { 7 | public interface IFileService 8 | { 9 | void Delete(string filePath, string fileName); 10 | void DeleteFolder(string folderPath); 11 | bool CreateFolder(string parentPath, string folderName); 12 | DirectoryViewModel FolderInfo(string dir); 13 | 14 | /// 15 | /// 16 | /// 17 | /// The relative path of the folder to store the file. 18 | /// 19 | /// 20 | string Upload(string destinationPath, HttpFileCollectionBase files); 21 | 22 | void WriteResponse(string localPath, string applicationPath, string modifiedSinceHeader, IResponseWrapper responseWrapper, HttpContext context); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Services/IInstallationService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Mvc.ViewModels; 4 | 5 | namespace Roadkill.Core.Services 6 | { 7 | public interface IInstallationService 8 | { 9 | IEnumerable GetSupportedDatabases(); 10 | void Install(SettingsViewModel model); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Services/ISettingsService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Roadkill.Core.Configuration; 3 | using Roadkill.Core.Database; 4 | using Roadkill.Core.Mvc.ViewModels; 5 | 6 | namespace Roadkill.Core.Services 7 | { 8 | public interface ISettingsService 9 | { 10 | IEnumerable GetSupportedDatabases(); 11 | 12 | /// 13 | /// Retrieves the current site settings. 14 | /// 15 | /// 16 | SiteSettings GetSiteSettings(); 17 | 18 | /// 19 | /// Saves all settings that are stored in the database, to the configuration table. 20 | /// 21 | /// Summary data containing the settings. 22 | /// An datastore error occurred while saving the configuration. 23 | void SaveSiteSettings(SettingsViewModel model); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Roadkill.Core/Text/IMarkupParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Roadkill.Core.Converters 7 | { 8 | /// 9 | /// Represents a class that can convert a markup syntax into HTML. The markups syntax 10 | /// should include formatting support as well as images and links. 11 | /// 12 | public interface IMarkupParser 13 | { 14 | /// 15 | /// Transforms the provided specific markup text to HTML 16 | /// 17 | string Transform(string transform); 18 | 19 | /// 20 | /// Occurs when an image tag is parsed. 21 | /// 22 | event EventHandler ImageParsed; 23 | 24 | /// 25 | /// Occurs when a hyperlink is parsed. 26 | /// 27 | event EventHandler LinkParsed; 28 | 29 | /// 30 | /// Help/documentation for the parser's tokens. 31 | /// 32 | MarkupParserHelp MarkupParserHelp { get; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Text/Sanitizer/HtmlAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Serialization; 6 | 7 | namespace Roadkill.Core.Text.Sanitizer 8 | { 9 | public class HtmlAttribute 10 | { 11 | [XmlAttribute] 12 | public string Name { get; set; } 13 | 14 | public HtmlAttribute() { } 15 | public HtmlAttribute(string name) 16 | { 17 | Name = name; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Roadkill.Core/Text/Sanitizer/HtmlElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Serialization; 6 | 7 | namespace Roadkill.Core.Text.Sanitizer 8 | { 9 | public class HtmlElement 10 | { 11 | [XmlAttribute] 12 | public string Name { get; set; } 13 | public List AllowedAttributes { get; set; } 14 | 15 | public HtmlElement() { } 16 | public HtmlElement(string name, string[] allowedAttributes) 17 | { 18 | Name = name; 19 | AllowedAttributes = new List(); 20 | foreach (string attribute in allowedAttributes) 21 | { 22 | AllowedAttributes.Add(new HtmlAttribute(attribute)); 23 | } 24 | } 25 | 26 | public bool ContainsAttribute(string name) 27 | { 28 | if (string.IsNullOrEmpty(name)) 29 | return false; 30 | 31 | return AllowedAttributes.Any(x => x.Name.ToLower() == name.ToLower()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Plugins/Text/BuiltIn/ClickableImages.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Plugins; 2 | 3 | namespace Roadkill.Plugins.Text.BuiltIn 4 | { 5 | public class ClickableImages : TextPlugin 6 | { 7 | public override string Id 8 | { 9 | get 10 | { 11 | return "ClickableImages"; 12 | } 13 | } 14 | 15 | public override string Name 16 | { 17 | get 18 | { 19 | return "Clickable images"; 20 | } 21 | } 22 | 23 | public override string Description 24 | { 25 | get 26 | { 27 | return "Configures images so when they are clicked the source image is opened in a new window."; 28 | } 29 | } 30 | 31 | public override string Version 32 | { 33 | 34 | get 35 | { 36 | return "1.0"; 37 | } 38 | } 39 | 40 | public ClickableImages() 41 | { 42 | AddScript("clickableimages.js"); 43 | } 44 | 45 | public override string GetHeadContent() 46 | { 47 | return GetJavascriptHtml(); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Roadkill.Plugins/Text/BuiltIn/ExternalLinksInNewWindow.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Plugins; 2 | 3 | namespace Roadkill.Plugins.Text.BuiltIn 4 | { 5 | public class ExternalLinksInNewWindow : TextPlugin 6 | { 7 | public override string Id 8 | { 9 | get 10 | { 11 | return "ExternalLinksInNewWindow"; 12 | } 13 | } 14 | 15 | public override string Name 16 | { 17 | get 18 | { 19 | return "External links in new window"; 20 | } 21 | } 22 | 23 | public override string Description 24 | { 25 | get 26 | { 27 | return "Configures all external links to open in a new window/tab."; 28 | } 29 | } 30 | 31 | public override string Version 32 | { 33 | 34 | get 35 | { 36 | return "1.0"; 37 | } 38 | } 39 | 40 | public ExternalLinksInNewWindow() 41 | { 42 | AddScript("externallinksinnewwindow.js"); 43 | } 44 | 45 | public override string GetHeadContent() 46 | { 47 | return GetJavascriptHtml(); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Roadkill.Plugins/Text/BuiltIn/ResizeImages.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Plugins; 2 | 3 | namespace Roadkill.Plugins.Text.BuiltIn 4 | { 5 | /// 6 | /// Sets images (via CSS) so they are no bigger than the page. 7 | /// 8 | public class ResizeImages : TextPlugin 9 | { 10 | public override string Id 11 | { 12 | get 13 | { 14 | return "ResizeImages"; 15 | } 16 | } 17 | 18 | public override string Name 19 | { 20 | get 21 | { 22 | return "Resize images"; 23 | } 24 | } 25 | 26 | public override string Description 27 | { 28 | get 29 | { 30 | return "Ensure all images are always fit the page."; 31 | } 32 | } 33 | 34 | public override string Version 35 | { 36 | 37 | get 38 | { 39 | return "1.0"; 40 | } 41 | } 42 | 43 | public override string GetHeadContent() 44 | { 45 | return GetCssLink("resizeimages.css"); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/Roadkill.Plugins/Text/BuiltIn/ToC/TocPlugin.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Plugins; 2 | 3 | namespace Roadkill.Plugins.Text.BuiltIn.ToC 4 | { 5 | public class TocPlugin : TextPlugin 6 | { 7 | public override string Id 8 | { 9 | get { return "ToC"; } 10 | } 11 | 12 | public override string Name 13 | { 14 | get { return "Table Of Contents"; } 15 | } 16 | 17 | public override string Description 18 | { 19 | get { return "Add a table of contents using the {TOC} tag"; } 20 | } 21 | 22 | public override string Version 23 | { 24 | 25 | get 26 | { 27 | return "1.0"; 28 | } 29 | } 30 | 31 | public TocPlugin() 32 | { 33 | AddScript("toc.js"); 34 | } 35 | 36 | public override string AfterParse(string html) 37 | { 38 | TocParser parser = new TocParser(); 39 | html = parser.InsertToc(html); 40 | 41 | return html; 42 | } 43 | 44 | public override string GetHeadContent() 45 | { 46 | string html = GetJavascriptHtml(); 47 | html += GetCssLink("toc.css"); 48 | 49 | return html; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Roadkill.Plugins/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Acceptance/Headless/RestApi/SearchControllerTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using NUnit.Framework; 4 | using Roadkill.Core.Mvc.ViewModels; 5 | 6 | namespace Roadkill.Tests.Acceptance.Headless.RestApi 7 | { 8 | [TestFixture] 9 | [Category("Acceptance")] 10 | public class SearchControllerTests : WebApiTestBase 11 | { 12 | [Test] 13 | public void search_should_return_result_based_on_query() 14 | { 15 | // Arrange 16 | AddPage("test", "this is page 1"); 17 | AddPage("page 2", "this is page 2"); 18 | var queryString = new Dictionary() 19 | { 20 | { "query", "test" } 21 | }; 22 | 23 | WebApiClient apiclient = new WebApiClient(); 24 | 25 | // Act 26 | apiclient.Get("Search/CreateIndex"); 27 | WebApiResponse> response = apiclient.Get>("Search", queryString); 28 | 29 | // Assert 30 | IEnumerable pages = response.Result; 31 | Assert.That(pages.Count(), Is.EqualTo(1), response); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Acceptance/Headless/RestApi/UserControllerTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using NUnit.Framework; 4 | using Roadkill.Core.Mvc.ViewModels; 5 | 6 | namespace Roadkill.Tests.Acceptance.Headless.RestApi 7 | { 8 | [TestFixture] 9 | [Category("Acceptance")] 10 | public class UserControllerTests : WebApiTestBase 11 | { 12 | [Test] 13 | public void getusers_should_return_all_users() 14 | { 15 | // Arrange 16 | WebApiClient apiclient = new WebApiClient(); 17 | 18 | // Act 19 | WebApiResponse> response = apiclient.Get>("User"); 20 | 21 | // Assert 22 | List results = response.Result; 23 | Assert.That(results.Count(), Is.EqualTo(2), response); 24 | } 25 | 26 | [Test] 27 | public void getuser_should_return_admin_user() 28 | { 29 | // Arrange 30 | var queryString = new Dictionary() 31 | { 32 | { "Id", ADMIN_ID.ToString() } 33 | }; 34 | 35 | WebApiClient apiclient = new WebApiClient(); 36 | 37 | // Act 38 | WebApiResponse response = apiclient.Get("User", queryString); 39 | 40 | // Assert 41 | UserViewModel userViewModel = response.Result; 42 | Assert.That(userViewModel, Is.Not.Null, response); 43 | Assert.That(userViewModel.Id, Is.EqualTo(ADMIN_ID), response); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Acceptance/Webdriver/InstallerTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Tests/Acceptance/Webdriver/InstallerTests.cs -------------------------------------------------------------------------------- /src/Roadkill.Tests/Acceptance/Webdriver/LocalizationTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Tests/Acceptance/Webdriver/LocalizationTests.cs -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-empty-defaults.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-empty.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-missing-values.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-mongodb.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-no-roadkillsection.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test-optional-values.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Configuration/TestConfigs/test.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/Dapper/DapperPageRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Roadkill.Core.Database; 4 | using Roadkill.Core.Database.Repositories.Dapper; 5 | 6 | namespace Roadkill.Tests.Integration.Repository.Dapper 7 | { 8 | [TestFixture] 9 | [Category("Integration")] 10 | public class DapperPageRepositoryTests : PageRepositoryTests 11 | { 12 | protected override string ConnectionString 13 | { 14 | get { return TestConstants.SQLSERVER_CONNECTION_STRING; } 15 | } 16 | 17 | protected override IPageRepository GetRepository() 18 | { 19 | var factory = new SqlConnectionFactory(ConnectionString); 20 | return new DapperPageRepository(factory); 21 | } 22 | 23 | protected override void Clearup() 24 | { 25 | TestHelpers.SqlServerSetup.RecreateTables(); 26 | TestHelpers.SqlServerSetup.ClearDatabase(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/Dapper/DapperSettingsRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Roadkill.Core.Database.Repositories; 4 | using Roadkill.Core.Database.Repositories.Dapper; 5 | 6 | namespace Roadkill.Tests.Integration.Repository.Dapper 7 | { 8 | [TestFixture] 9 | [Category("Integration")] 10 | public class DapperSettingsRepositoryTests : SettingsRepositoryTests 11 | { 12 | protected override string ConnectionString => TestConstants.SQLSERVER_CONNECTION_STRING; 13 | 14 | protected override string InvalidConnectionString 15 | { 16 | get 17 | { 18 | return TestConstants.SQLSERVER_CONNECTION_STRING.Replace("Database=", "DatabaseInator="); 19 | } 20 | } 21 | 22 | protected override ISettingsRepository GetRepository() 23 | { 24 | var factory = new SqlConnectionFactory(ConnectionString); 25 | return new DapperSettingsRepository(factory); 26 | } 27 | 28 | protected override void Clearup() 29 | { 30 | TestHelpers.SqlServerSetup.RecreateTables(); 31 | TestHelpers.SqlServerSetup.ClearDatabase(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/Dapper/DapperUserRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Roadkill.Core.Database; 4 | using Roadkill.Core.Database.Repositories.Dapper; 5 | 6 | namespace Roadkill.Tests.Integration.Repository.Dapper 7 | { 8 | [TestFixture] 9 | [Category("Integration")] 10 | public class DapperUserRepositoryTests : UserRepositoryTests 11 | { 12 | protected override string ConnectionString => TestConstants.SQLSERVER_CONNECTION_STRING; 13 | 14 | protected override IUserRepository GetRepository() 15 | { 16 | var factory = new SqlConnectionFactory(ConnectionString); 17 | return new DapperUserRepository(factory); 18 | } 19 | 20 | protected override void Clearup() 21 | { 22 | TestHelpers.SqlServerSetup.RecreateTables(); 23 | TestHelpers.SqlServerSetup.ClearDatabase(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/LightSpeed/LightSpeedUserRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mindscape.LightSpeed; 3 | using NUnit.Framework; 4 | using Roadkill.Core.Database; 5 | using Roadkill.Core.Database.LightSpeed; 6 | 7 | namespace Roadkill.Tests.Integration.Repository.LightSpeed 8 | { 9 | [TestFixture] 10 | [Category("Integration")] 11 | public class LightSpeedUserRepositoryTests : UserRepositoryTests 12 | { 13 | [ThreadStatic] 14 | private static LightSpeedContext _context; 15 | 16 | public LightSpeedContext Context 17 | { 18 | get 19 | { 20 | if (_context == null) 21 | { 22 | _context = new LightSpeedContext(); 23 | _context.ConnectionString = ConnectionString; 24 | _context.DataProvider = DataProvider.SqlServer2008; 25 | _context.IdentityMethod = IdentityMethod.GuidComb; 26 | } 27 | 28 | return _context; 29 | } 30 | } 31 | 32 | protected override string ConnectionString 33 | { 34 | get { return TestConstants.SQLSERVER_CONNECTION_STRING; } 35 | } 36 | 37 | protected override IUserRepository GetRepository() 38 | { 39 | return new LightSpeedUserRepository(Context.CreateUnitOfWork()); 40 | } 41 | 42 | protected override void Clearup() 43 | { 44 | TestHelpers.SqlServerSetup.ClearDatabase(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/MongoDb/MongoDbPageRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Database.MongoDB; 4 | 5 | namespace Roadkill.Tests.Integration.Repository.MongoDb 6 | { 7 | [TestFixture] 8 | [Category("Integration")] 9 | public class MongoDbPageRepositoryTests : PageRepositoryTests 10 | { 11 | protected override string ConnectionString 12 | { 13 | get { return @"mongodb://localhost:27017/local"; } 14 | } 15 | 16 | protected override IPageRepository GetRepository() 17 | { 18 | return new MongoDBPageRepository(ConnectionString); 19 | } 20 | 21 | protected override void Clearup() 22 | { 23 | new MongoDBPageRepository(ConnectionString).Wipe(); 24 | } 25 | 26 | protected override void CheckDatabaseProcessIsRunning() 27 | { 28 | if (TestHelpers.IsMongoDBRunning() == false) 29 | Assert.Fail("A local MongoDB (mongod.exe) server is not running"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/MongoDb/MongoDbSettingsRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Roadkill.Core.Database.MongoDB; 3 | using Roadkill.Core.Database.Repositories; 4 | 5 | namespace Roadkill.Tests.Integration.Repository.MongoDb 6 | { 7 | [TestFixture] 8 | [Category("Integration")] 9 | public class MongoDbSettingsRepositoryTests : SettingsRepositoryTests 10 | { 11 | protected override string ConnectionString 12 | { 13 | get { return @"mongodb://localhost:27017/local"; } 14 | } 15 | 16 | protected override string InvalidConnectionString 17 | { 18 | get { return "mongodb://invalidformat"; } 19 | } 20 | 21 | protected override ISettingsRepository GetRepository() 22 | { 23 | return new MongoDBSettingsRepository(ConnectionString); 24 | } 25 | 26 | protected override void Clearup() 27 | { 28 | new MongoDBSettingsRepository(ConnectionString).Wipe(); 29 | } 30 | 31 | protected override void CheckDatabaseProcessIsRunning() 32 | { 33 | if (TestHelpers.IsMongoDBRunning() == false) 34 | Assert.Fail("A local MongoDB (mongod.exe) server is not running"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Integration/Repository/MongoDb/MongoDbUserRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Database.MongoDB; 4 | 5 | namespace Roadkill.Tests.Integration.Repository.MongoDb 6 | { 7 | [TestFixture] 8 | [Category("Integration")] 9 | public class MongoDbUserRepositoryTests : UserRepositoryTests 10 | { 11 | protected override string ConnectionString 12 | { 13 | get { return @"mongodb://localhost:27017/local"; } 14 | } 15 | 16 | protected override IUserRepository GetRepository() 17 | { 18 | return new MongoDBUserRepository(ConnectionString); 19 | } 20 | 21 | protected override void Clearup() 22 | { 23 | new MongoDBUserRepository(ConnectionString).Wipe(); 24 | } 25 | 26 | protected override void CheckDatabaseProcessIsRunning() 27 | { 28 | if (TestHelpers.IsMongoDBRunning() == false) 29 | Assert.Fail("A local MongoDB (mongod.exe) server is not running"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Roadkill.Tests.csproj.VisualState.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | [0-1000]C:\Users\corsair\Documents\GitHub\Roadkill\Roadkill.Tests\Roadkill.Tests.csproj 4 | [0-1000]C:\Users\corsair\Documents\GitHub\Roadkill\Roadkill.Tests\Roadkill.Tests.csproj 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Attachments/ResponseWrapperMock.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Attachments; 2 | 3 | namespace Roadkill.Tests.Unit.Attachments 4 | { 5 | public class ResponseWrapperMock : IResponseWrapper 6 | { 7 | public int StatusCode { get; set; } 8 | public string ContentType { get; set; } 9 | 10 | public byte[] Buffer { get; set; } 11 | public string Text { get; set; } 12 | 13 | public void AddStatusCodeForCache(string fullPath, string modifiedSinceHeader) 14 | { 15 | StatusCode = 200; 16 | } 17 | 18 | public void BinaryWrite(byte[] buffer) 19 | { 20 | Buffer = buffer; 21 | } 22 | 23 | public void End() 24 | { 25 | 26 | } 27 | 28 | public void Write(string text) 29 | { 30 | Text = text; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Attachments/afile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Tests/Unit/Attachments/afile.jpg -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Cache/PageViewModelCacheTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Caching; 5 | using System.Text; 6 | using NUnit.Framework; 7 | using Roadkill.Core.Cache; 8 | using Roadkill.Core.Configuration; 9 | using Roadkill.Core.Database; 10 | using Roadkill.Core.Mvc.ViewModels; 11 | using Roadkill.Tests.Unit.StubsAndMocks; 12 | 13 | namespace Roadkill.Tests.Unit.Cache 14 | { 15 | /// 16 | /// Most of the PageViewModelCache tests are in the pageservicetests, to test 17 | /// the integration between the cache and the pageservice. 18 | /// 19 | [TestFixture] 20 | [Category("Unit")] 21 | public class PageViewModelCacheTests 22 | { 23 | [Test] 24 | public void removeall_should_remove_pageviewmodelcache_keys_only() 25 | { 26 | // Arrange 27 | CacheMock cache = new CacheMock(); 28 | cache.Add("site.blah", "xyz", new CacheItemPolicy()); 29 | 30 | ApplicationSettings settings = new ApplicationSettings() { UseObjectCache = false }; 31 | PageViewModelCache pageCache = new PageViewModelCache(settings, cache); 32 | pageCache.Add(1, 1, new PageViewModel()); 33 | 34 | // Act 35 | pageCache.RemoveAll(); 36 | 37 | // Assert 38 | Assert.That(cache.Count(), Is.EqualTo(1)); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Database/EntityTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using NUnit.Framework; 7 | using Roadkill.Core.Database; 8 | 9 | namespace Roadkill.Tests.Unit.Database 10 | { 11 | [TestFixture] 12 | public class EntityTests 13 | { 14 | [Test] 15 | public void user_objectid_should_match_id() 16 | { 17 | // Arrange 18 | User user = new User(); 19 | user.Id = Guid.NewGuid(); 20 | 21 | // Act 22 | Guid objectId = user.ObjectId; 23 | 24 | // Assert 25 | Assert.That(objectId, Is.EqualTo(user.Id)); 26 | } 27 | 28 | [Test] 29 | public void pagecontent_objectid_should_match_id() 30 | { 31 | // Arrange 32 | PageContent page = new PageContent(); 33 | page.ObjectId = Guid.NewGuid(); 34 | 35 | // Act 36 | Guid objectId = page.ObjectId; 37 | 38 | // Assert 39 | Assert.That(objectId, Is.EqualTo(page.Id)); 40 | } 41 | 42 | [Test] 43 | public void siteconfigurationentity_objectid_should_match_id() 44 | { 45 | // Arrange 46 | SiteConfigurationEntity siteConfigEntity = new SiteConfigurationEntity(); 47 | siteConfigEntity.ObjectId = Guid.NewGuid(); 48 | 49 | // Act 50 | Guid objectId = siteConfigEntity.ObjectId; 51 | 52 | // Assert 53 | Assert.That(objectId, Is.EqualTo(siteConfigEntity.Id)); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Export/expected-users-export.sql: -------------------------------------------------------------------------------- 1 | -- You will need to enable identity inserts for your chosen db before running this Script, for example in SQL Server: 2 | -- SET IDENTITY_INSERT roadkill_pages ON; 3 | 4 | -- Users 5 | INSERT INTO roadkill_users (id, activationkey, email, firstname, iseditor, isadmin, isactivated, lastname, password, passwordresetkey, salt, username) VALUES ('29a8ad19-b203-46f5-be10-11e0ebf6f812','0953cf95-f357-4e5b-ae2b-7541844d3b6b','user1@localhost','firstname1','0','1','1','lastname1','encrypted1','','salt1','user1'); 6 | INSERT INTO roadkill_users (id, activationkey, email, firstname, iseditor, isadmin, isactivated, lastname, password, passwordresetkey, salt, username) VALUES ('e63b0023-329a-49b9-97a4-5094a0e378a2','aa87fe31-9781-4c93-b7e3-9092ed095810','user2@localhost','firstname2','1','0','1','lastname2','encrypted2','','salt2','user2'); 7 | INSERT INTO roadkill_users (id, activationkey, email, firstname, iseditor, isadmin, isactivated, lastname, password, passwordresetkey, salt, username) VALUES ('a6ee19ef-c093-47de-97d2-83dec406d92d','b8ef994d-87f5-4543-85de-66b41244a20a','user3@localhost','firstname3','1','0','0','lastname3','encrypted3','','salt3','user3'); 8 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Mvc/ViewModels/DirectoryViewModelTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Roadkill.Core.Mvc.ViewModels; 3 | 4 | namespace Roadkill.Tests.Unit.Mvc.ViewModels 5 | { 6 | // Slightly lame property tests 7 | [TestFixture] 8 | [Category("Unit")] 9 | public class DirectoryViewModelTests 10 | { 11 | [Test] 12 | public void constructor_should_fill_properties() 13 | { 14 | // Arrange 15 | string name = "MyDirectory"; 16 | string urlPath = "/Home/MyDirectory"; 17 | 18 | // Act 19 | DirectoryViewModel model = new DirectoryViewModel(name, urlPath); 20 | 21 | // Assert 22 | Assert.That(model.Name, Is.EqualTo(name)); 23 | Assert.That(model.UrlPath, Is.EqualTo(urlPath)); 24 | } 25 | 26 | [Test] 27 | public void constructor_should_create_empty_files_and_childfolders() 28 | { 29 | // Arrange + Act 30 | DirectoryViewModel model = new DirectoryViewModel("", ""); 31 | 32 | // Assert 33 | Assert.That(model.Files.Count, Is.EqualTo(0)); 34 | Assert.That(model.ChildFolders.Count, Is.EqualTo(0)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Mvc/ViewModels/FileViewModelTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using Roadkill.Core.Mvc.ViewModels; 4 | 5 | namespace Roadkill.Tests.Unit.Mvc.ViewModels 6 | { 7 | // Not much to see here - lame property tests 8 | [TestFixture] 9 | [Category("Unit")] 10 | public class FileViewModelTests 11 | { 12 | [Test] 13 | public void constructor_should_fill_properties_and_create_empty_files_and_childfolders() 14 | { 15 | // Arrange 16 | string name = "random.jpg"; 17 | string extension = "jpg"; 18 | long size = 1241241; 19 | DateTime createDate = DateTime.Today; 20 | string folder = "/Home/MyDirectory"; 21 | 22 | // Act 23 | FileViewModel model = new FileViewModel(name, extension, size, createDate, folder); 24 | 25 | // Assert 26 | Assert.That(model.Name, Is.EqualTo(name)); 27 | Assert.That(model.Extension, Is.EqualTo(extension)); 28 | Assert.That(model.Size, Is.EqualTo(size)); 29 | Assert.That(model.CreateDate, Is.EqualTo(createDate.ToShortDateString())); 30 | Assert.That(model.Folder, Is.EqualTo(folder)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Mvc/ViewModels/LanguageViewModelTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using NUnit.Framework; 4 | using Roadkill.Core.Mvc.ViewModels; 5 | 6 | namespace Roadkill.Tests.Unit.Mvc.ViewModels 7 | { 8 | [TestFixture] 9 | [Category("Unit")] 10 | public class LanguageViewModelTests 11 | { 12 | [Test] 13 | public void constructor_should_set_properties() 14 | { 15 | // Arrange 16 | string code = "en-GB"; 17 | string name = "Her Majesty's British English"; 18 | 19 | // Act 20 | LanguageViewModel model = new LanguageViewModel(code, name); 21 | 22 | // Assert 23 | Assert.That(model.Code, Is.EqualTo(code)); 24 | Assert.That(model.Name, Is.EqualTo(name)); 25 | } 26 | 27 | [Test] 28 | public void supportedlocales_should_return_list_of_languages() 29 | { 30 | // Arrange + Act 31 | IEnumerable languages = LanguageViewModel.SupportedLocales(); 32 | 33 | // Assert 34 | Assert.That(languages.Count(), Is.EqualTo(12)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Mvc/ViewModels/TestResultTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using NUnit.Framework; 7 | using Roadkill.Core.Mvc.ViewModels; 8 | 9 | namespace Roadkill.Tests.Unit.Mvc.ViewModels 10 | { 11 | [TestFixture] 12 | [Category("Unit")] 13 | public class TestResultTests 14 | { 15 | [Test] 16 | public void constructor_should_set_error_message_property() 17 | { 18 | // Act + Arrange 19 | TestResult result = new TestResult("some error"); 20 | 21 | // Assert 22 | Assert.That(result.ErrorMessage, Is.EqualTo("some error")); 23 | } 24 | 25 | [Test] 26 | public void success_should_be_true_when_error_message_is_empty() 27 | { 28 | // Act + Arrange 29 | TestResult result = new TestResult(""); 30 | 31 | // Assert 32 | Assert.That(result.Success, Is.True); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Plugins/PluginFileManagerTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace Roadkill.Tests.Unit.Plugins 4 | { 5 | public class PluginFileManagerTests 6 | { 7 | // TODO 8 | [Test] 9 | public void method_should() 10 | { 11 | // Arrange 12 | 13 | // Act 14 | 15 | // Assert 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/ActiveDirectoryProviderMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Roadkill.Core.Security.Windows; 7 | 8 | namespace Roadkill.Tests.Unit.StubsAndMocks 9 | { 10 | public class ActiveDirectoryProviderMock : IActiveDirectoryProvider 11 | { 12 | public string LdapConnectionResult { get; set; } 13 | 14 | public IEnumerable GetMembers(string domainName, string username, string password, string groupName) 15 | { 16 | return new List(); 17 | } 18 | 19 | public string TestLdapConnection(string connectionString, string username, string password, string groupName) 20 | { 21 | return LdapConnectionResult; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/AuthorizationProviderMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Principal; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Roadkill.Core.Security; 8 | 9 | namespace Roadkill.Tests.Unit.StubsAndMocks 10 | { 11 | public class AuthorizationProviderMock : IAuthorizationProvider 12 | { 13 | public bool IsAdminResult { get; set; } 14 | public bool IsEditorResult { get; set; } 15 | public bool IsViewerResult { get; set; } 16 | 17 | public bool IsAdmin(IPrincipal principal) 18 | { 19 | return IsAdminResult; 20 | } 21 | 22 | public bool IsEditor(IPrincipal principal) 23 | { 24 | return IsEditorResult; 25 | } 26 | 27 | public bool IsViewer(IPrincipal principal) 28 | { 29 | return IsViewerResult; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/DatabaseTesterMock.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core; 2 | using Roadkill.Core.Database; 3 | 4 | namespace Roadkill.Tests.Unit.StubsAndMocks 5 | { 6 | public class DatabaseTesterMock : IDatabaseTester 7 | { 8 | public bool IsConnectionValid { get; set; } 9 | 10 | public void TestConnection(string databaseProvider, string connectionString) 11 | { 12 | if (!IsConnectionValid) 13 | { 14 | throw new DatabaseException("InstallerRepositoryMock", null); 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/DbCommandStub.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Roadkill.Tests.Unit.StubsAndMocks 9 | { 10 | public class DbCommandStub : IDbCommand 11 | { 12 | public string CommandText { get; set; } 13 | public int CommandTimeout { get; set; } 14 | public CommandType CommandType { get; set; } 15 | public IDbConnection Connection { get; set; } 16 | public IDbTransaction Transaction { get; set; } 17 | public UpdateRowSource UpdatedRowSource { get; set; } 18 | public IDataParameterCollection Parameters { get; set; } 19 | 20 | public IDbDataParameter CreateParameter() 21 | { 22 | return null; 23 | } 24 | 25 | public void Cancel() 26 | { 27 | } 28 | 29 | public int ExecuteNonQuery() 30 | { 31 | return 1; 32 | } 33 | 34 | public IDataReader ExecuteReader(CommandBehavior behavior) 35 | { 36 | return null; 37 | } 38 | 39 | public IDataReader ExecuteReader() 40 | { 41 | return null; 42 | } 43 | 44 | public object ExecuteScalar() 45 | { 46 | return 1; 47 | } 48 | 49 | public void Prepare() 50 | { 51 | } 52 | 53 | public void Dispose() 54 | { 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/EmailClientMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Mail; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Roadkill.Core.Email; 8 | 9 | namespace Roadkill.Tests.Unit.StubsAndMocks 10 | { 11 | public class EmailClientMock : IEmailClient 12 | { 13 | public string PickupDirectoryLocation { get; set; } 14 | public SmtpDeliveryMethod DeliveryMethod { get; set; } 15 | public bool Sent { get; set; } 16 | public MailMessage Message { get; set; } 17 | 18 | public void Send(MailMessage message) 19 | { 20 | Sent = true; 21 | Message = message; 22 | } 23 | 24 | public SmtpDeliveryMethod GetDeliveryMethod() 25 | { 26 | return DeliveryMethod; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/EmailTemplateStub.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Configuration; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Database.Repositories; 4 | using Roadkill.Core.Email; 5 | using Roadkill.Core.Mvc.ViewModels; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks 8 | { 9 | public class EmailTemplateStub : EmailTemplate 10 | { 11 | public EmailTemplateStub(ApplicationSettings applicationSettings, ISettingsRepository settingsRepository, IEmailClient emailClient) 12 | : base(applicationSettings, settingsRepository, emailClient) 13 | { 14 | base.PlainTextView = "plaintextview"; 15 | base.HtmlView = "htmlview"; 16 | } 17 | 18 | public override void Send(UserViewModel model) 19 | { 20 | base.Send(model); 21 | } 22 | 23 | public IEmailClient GetEmailClient() 24 | { 25 | return base.EmailClient; 26 | } 27 | 28 | public SiteSettings GetSiteSettings() 29 | { 30 | return SiteSettings; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/IdentityStub.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Principal; 5 | using System.Text; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks 8 | { 9 | public class IdentityStub : IIdentity 10 | { 11 | public string AuthenticationType { get; set; } 12 | public bool IsAuthenticated { get; set; } 13 | public string Name { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/Mvc/HttpCachePolicyMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks.Mvc 8 | { 9 | public class HttpCachePolicyMock : HttpCachePolicyBase 10 | { 11 | public HttpCacheability HttpCacheability { get; set; } 12 | public DateTime Expires { get; set; } 13 | public TimeSpan MaxAge { get; set; } 14 | public DateTime LastModified { get; set; } 15 | 16 | public override void SetCacheability(HttpCacheability cacheability) 17 | { 18 | HttpCacheability = cacheability; 19 | } 20 | 21 | public override void SetExpires(DateTime date) 22 | { 23 | Expires = date; 24 | } 25 | 26 | public override void SetMaxAge(TimeSpan delta) 27 | { 28 | MaxAge = delta; 29 | } 30 | 31 | public override void SetLastModified(DateTime date) 32 | { 33 | LastModified = date; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/Mvc/MvcMockContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using Moq; 3 | 4 | namespace Roadkill.Tests.Unit.StubsAndMocks.Mvc 5 | { 6 | /// 7 | /// Provides access to the Mock objects for the MVC mock helper extention methods. 8 | /// 9 | public class MvcMockContainer 10 | { 11 | public Mock Context { get; set; } 12 | public Mock Request { get; set; } 13 | public Mock Response { get; set; } 14 | public Mock SessionState { get; set; } 15 | public Mock ServerUtility { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/Owin/OwinContextStub.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using Microsoft.Owin; 4 | using Microsoft.Owin.Security; 5 | 6 | namespace Roadkill.Tests.Unit.StubsAndMocks.Owin 7 | { 8 | public class OwinContextStub : IOwinContext 9 | { 10 | private OwinRequestStub _request; 11 | 12 | IOwinRequest IOwinContext.Request 13 | { 14 | get { return _request; } 15 | } 16 | 17 | public OwinRequestStub Request 18 | { 19 | get { return _request; } 20 | } 21 | 22 | public IOwinResponse Response { get; set; } 23 | public IAuthenticationManager Authentication { get; set; } 24 | public IDictionary Environment { get; set; } 25 | public TextWriter TraceOutput { get; set; } 26 | 27 | public OwinContextStub() 28 | { 29 | _request = new OwinRequestStub(); 30 | Response = new OwinResponse(); 31 | } 32 | 33 | public T Get(string key) 34 | { 35 | return default(T); 36 | } 37 | 38 | public IOwinContext Set(string key, T value) 39 | { 40 | return null; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/PrincipalStub.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Principal; 5 | using System.Text; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks 8 | { 9 | public class PrincipalStub : IPrincipal 10 | { 11 | public IIdentity Identity { get; set; } 12 | public bool IsInRoleResult { get; set; } 13 | 14 | public bool IsInRole(string role) 15 | { 16 | return IsInRoleResult; 17 | } 18 | 19 | public void SetAuthenticate(bool authenticated) 20 | { 21 | ((IdentityStub)Identity).IsAuthenticated = authenticated; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/ResetPasswordEmailStub.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Configuration; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Database.Repositories; 4 | using Roadkill.Core.Email; 5 | using Roadkill.Core.Mvc.ViewModels; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks 8 | { 9 | public class ResetPasswordEmailStub : ResetPasswordEmail 10 | { 11 | public bool IsSent { get; set; } 12 | public UserViewModel Model { get; set; } 13 | 14 | public ResetPasswordEmailStub(ApplicationSettings applicationSettings, ISettingsRepository settingsRepository, IEmailClient emailClient) 15 | : base(applicationSettings, settingsRepository, emailClient) 16 | { 17 | } 18 | 19 | public override void Send(UserViewModel model) 20 | { 21 | ReplaceTokens(model, "{EMAIL}"); 22 | IsSent = true; 23 | Model = model; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/SignupEmailStub.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core.Configuration; 2 | using Roadkill.Core.Database; 3 | using Roadkill.Core.Database.Repositories; 4 | using Roadkill.Core.Email; 5 | using Roadkill.Core.Mvc.ViewModels; 6 | 7 | namespace Roadkill.Tests.Unit.StubsAndMocks 8 | { 9 | public class SignupEmailStub : SignupEmail 10 | { 11 | public bool IsSent { get; set; } 12 | public UserViewModel ViewModel { get; set; } 13 | 14 | public SignupEmailStub(ApplicationSettings applicationSettings, ISettingsRepository settingsRepository, IEmailClient emailClient) 15 | : base(applicationSettings, settingsRepository, emailClient) 16 | { 17 | } 18 | 19 | public override void Send(UserViewModel model) 20 | { 21 | ReplaceTokens(model, "{EMAIL}"); 22 | IsSent = true; 23 | ViewModel = model; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/SpecialPageMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Web.Mvc; 7 | using Roadkill.Core.Mvc.Controllers; 8 | using Roadkill.Core.Plugins; 9 | 10 | namespace Roadkill.Tests.Unit.StubsAndMocks 11 | { 12 | public class SpecialPageMock : SpecialPagePlugin 13 | { 14 | public override string Name 15 | { 16 | get { return "kay"; } 17 | } 18 | 19 | public override ActionResult GetResult(SpecialPagesController controller) 20 | { 21 | return new ContentResult() { Content = "Some content" }; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/UrlResolverStub.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Roadkill.Core.Text; 7 | 8 | namespace Roadkill.Tests.Unit.StubsAndMocks 9 | { 10 | public class UrlResolverMock : UrlResolver 11 | { 12 | public string AbsolutePathSuffix { get; set; } 13 | public string InternalUrl { get; set; } 14 | public string NewPageUrl { get; set; } 15 | 16 | public override string ConvertToAbsolutePath(string relativeUrl) 17 | { 18 | if (!string.IsNullOrEmpty(AbsolutePathSuffix)) 19 | return relativeUrl + AbsolutePathSuffix; 20 | else 21 | return relativeUrl; 22 | } 23 | 24 | public override string GetInternalUrlForTitle(int id, string title) 25 | { 26 | if (!string.IsNullOrEmpty(InternalUrl)) 27 | return InternalUrl; 28 | else 29 | return title; 30 | } 31 | 32 | public override string GetNewPageUrlForTitle(string title) 33 | { 34 | if (!string.IsNullOrEmpty(NewPageUrl)) 35 | return NewPageUrl; 36 | else 37 | return title; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/UserContextStub.cs: -------------------------------------------------------------------------------- 1 | using Roadkill.Core; 2 | using Roadkill.Core.Mvc.ViewModels; 3 | 4 | namespace Roadkill.Tests.Unit.StubsAndMocks 5 | { 6 | internal class UserContextStub : IUserContext 7 | { 8 | public string CurrentUser { get; set; } 9 | public string CurrentUsername { get; set; } 10 | public bool IsAdmin { get; set; } 11 | public bool IsContentPage { get; set; } 12 | public bool IsEditor { get; set; } 13 | public bool IsLoggedIn { get; set; } 14 | public PageViewModel Page { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/StubsAndMocks/WikiImporterMock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Roadkill.Core.Import; 7 | using Roadkill.Core.Services; 8 | 9 | namespace Roadkill.Tests.Unit.StubsAndMocks 10 | { 11 | public class WikiImporterMock : IWikiImporter 12 | { 13 | public bool ImportedFromSql { get; set; } 14 | public bool UpdatedSearch { get; set; } 15 | 16 | public void ImportFromSqlServer(string connectionString) 17 | { 18 | ImportedFromSql = true; 19 | } 20 | 21 | public void UpdateSearchIndex(SearchService searchService) 22 | { 23 | UpdatedSearch = true; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/Unit/Text/whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Roadkill.Tests/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Tests/chromedriver.exe -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/Attachments/emptyfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/Attachments/emptyfile.txt -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/EmailTemplates/ResetPassword.html: -------------------------------------------------------------------------------- 1 |  2 | 3 |

4 | Dear {FIRSTNAME} {LASTNAME}, 5 |

6 | 7 |

8 | You recently requested a password reset for {SITENAME}. To reset your password please click the link below. 9 |

10 | 11 |

12 | Reset your password 13 |

14 | 15 |

The IP of the request was {REQUEST_IP}

16 | 17 | -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/EmailTemplates/ResetPassword.txt: -------------------------------------------------------------------------------- 1 | Dear {FIRSTNAME} {LASTNAME}, 2 | 3 | You recently requested a password reset for {SITENAME}. To reset your password please enter the link below into your browser. 4 | 5 | {SITEURL}/user/completeresetpassword/{RESETKEY} 6 | 7 | The IP of the request was {REQUEST_IP} -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/EmailTemplates/Signup.html: -------------------------------------------------------------------------------- 1 |  2 | 3 |

4 | Dear {FIRSTNAME} {LASTNAME}, 5 |

6 | 7 |

8 | Thank you for registering with {SITENAME}. Your username is {USERNAME}. To complete the signup process, please click the link below to activate your account. 9 |

10 | 11 |

12 | Activate your account 13 |

14 | 15 | -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/EmailTemplates/Signup.txt: -------------------------------------------------------------------------------- 1 | Dear {FIRSTNAME} {LASTNAME}, 2 | 3 | Thank you for registering with {SITENAME}. Your username is {USERNAME}. To complete the signup process, please enter the link below into your browser to activate your account. 4 | 5 | {SITEURL}/user/activate/{ACTIVATIONKEY} -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/Internal/Export/emptyfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/Internal/Export/emptyfile.txt -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/Logs/emptyfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/Logs/emptyfile.txt -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/NLog.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/roadkill-acceptancetests.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/roadkill-acceptancetests.sdf -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/roadkill.mdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/roadkill.mdf -------------------------------------------------------------------------------- /src/Roadkill.Web/App_Data/roadkill152.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/App_Data/roadkill152.sdf -------------------------------------------------------------------------------- /src/Roadkill.Web/Areas/SiteSettings/Views/PluginSettings/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = @SiteStrings.SiteSettings_Plugins_Title; 4 | ViewData["PluginSettingsActive"] = true; 5 | } 6 | 7 | @Html.SiteSettingsNavigation() 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | @foreach (PluginViewModel pluginModel in Model) 19 | { 20 | 21 | 22 | 23 | 24 | 25 | } 26 | 27 |
@SiteStrings.SiteSettings_Plugins_ColumnHeader_Name@SiteStrings.SiteSettings_Plugins_ColumnHeader_Description
@Html.Raw(pluginModel.EnabledSymbol)@Html.ActionLink(pluginModel.Name, "Edit", new { id = pluginModel.Id})@Html.Raw(pluginModel.Description)
28 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Areas/SiteSettings/Views/UserManagement/IndexReadOnly.cshtml: -------------------------------------------------------------------------------- 1 | @using Roadkill.Core.Configuration; 2 | @model IList> 3 | @{ 4 | ViewBag.Title = SiteStrings.SiteSettings_UserManagement_Title; 5 | ViewData["UsersActive"] = true; 6 | } 7 | 8 | @Html.SiteSettingsNavigation() 9 | 10 |
11 |

12 | @SiteStrings.SiteSettings_UserManagement_AD_Title 13 |

14 | 15 |

16 | @SiteStrings.SiteSettings_UserManagement_AD_Label1 17 |

18 | 19 |

20 | @SiteStrings.SiteSettings_UserManagement_AD_Label2 21 |

22 | 23 |

@SiteStrings.SiteSettings_UserManagement_Admins (using group '@ApplicationSettings.AdminRoleName')

24 | 25 | @foreach (UserViewModel user in Model[0]) 26 | { 27 | 28 | 29 | 30 | } 31 |
@user.ExistingEmail
32 |
33 | 34 |

@SiteStrings.SiteSettings_UserManagement_Editors (using group '@ApplicationSettings.EditorRoleName')

35 | 36 | @foreach (UserViewModel user in Model[1]) 37 | { 38 | 39 | 40 | 41 | } 42 |
@user.ExistingEmail
43 |
44 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Areas/SiteSettings/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @using Roadkill.Core.Configuration; 2 | @{ 3 | // A direct copy of ~/Views/_ViewStart.cshtml 4 | Roadkill.Core.Mvc.Controllers.ControllerBase controller = this.ViewContext.Controller as Roadkill.Core.Mvc.Controllers.ControllerBase; 5 | ApplicationSettings applicationSettings = controller.ApplicationSettings; 6 | 7 | if (applicationSettings.Installed) 8 | { 9 | SiteSettings siteSettings = controller.SettingsService.GetSiteSettings(); 10 | Layout = siteSettings.ThemePath + "/Theme.cshtml"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Areas/SiteSettings/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/_htmldiff.scss: -------------------------------------------------------------------------------- 1 | /* *************************************** 2 | ** Diff related styles 3 | *****************************************/ 4 | 5 | #diff-pagecontent table { 6 | border:1px solid #d9d9d9; 7 | } 8 | 9 | #diff-pagecontent td { 10 | border:1px solid #d9d9d9; 11 | padding:3px; 12 | } 13 | 14 | #diff-pagecontent ins { 15 | background-color: #cfc; 16 | text-decoration:inherit; 17 | 18 | } 19 | 20 | #diff-pagecontent del { 21 | color: #999; 22 | background-color:#FEC8C8; 23 | } 24 | 25 | #diff-pagecontent ins.mod { 26 | background-color: #FFE1AC; 27 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/_jquery.fileupload.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /* 3 | * jQuery File Upload Plugin CSS 1.3.0 4 | * https://github.com/blueimp/jQuery-File-Upload 5 | * 6 | * Copyright 2013, Sebastian Tschan 7 | * https://blueimp.net 8 | * 9 | * Licensed under the MIT license: 10 | * http://www.opensource.org/licenses/MIT 11 | */ 12 | 13 | .fileinput-button { 14 | position: relative; 15 | overflow: hidden; 16 | } 17 | .fileinput-button input { 18 | position: absolute; 19 | top: 0; 20 | right: 0; 21 | margin: 0; 22 | opacity: 0; 23 | -ms-filter: 'alpha(opacity=0)'; 24 | font-size: 200px; 25 | direction: ltr; 26 | cursor: pointer; 27 | } 28 | 29 | /* Fixes for IE < 8 */ 30 | @media screen\9 { 31 | .fileinput-button input { 32 | filter: alpha(opacity=0); 33 | font-size: 100%; 34 | height: 100%; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/animated-overlay.gif -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/blank.gif -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/plugin-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/plugin-disabled.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/plugin-enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/plugin-enabled.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/spinner.gif -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_ffffff_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/CSS/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/CSS/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/button-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/button-loading.gif -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/favicon.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/filemanager/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/filemanager/cancel.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/filemanager/directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/filemanager/directory.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/filemanager/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/filemanager/file.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/installer-ex-chicken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/installer-ex-chicken.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/roadkill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/roadkill.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Images/white-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Images/white-loading.gif -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/dialogs.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web 3 | { 4 | export class Dialogs 5 | { 6 | public static alert(message: string) 7 | { 8 | bootbox.setDefaults({ animate: false }); 9 | bootbox.alert(message); 10 | } 11 | 12 | public static confirm(title: string, resultFunction: (result: boolean) => void) 13 | { 14 | bootbox.setDefaults({ animate: false }); 15 | bootbox.confirm("" + title + "", resultFunction); 16 | } 17 | 18 | public static openModal(selector: string) 19 | { 20 | $(selector).modal("show"); 21 | } 22 | 23 | public static openMarkupHelpModal(html: string) 24 | { 25 | $("#markup-help-dialog .modal-body-container").html(html); 26 | $("#markup-help-dialog").modal("show"); 27 | } 28 | 29 | public static openImageChooserModal(html: string) 30 | { 31 | $("#choose-image-dialog .modal-body-container").html(html); 32 | $("#choose-image-dialog").modal("show"); 33 | } 34 | 35 | public static closeImageChooserModal() 36 | { 37 | $("#choose-image-dialog").modal("hide"); 38 | } 39 | 40 | public static closeModal(selector: string) 41 | { 42 | $(selector).modal("hide"); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/filemanager/util.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web.FileManager 3 | { 4 | export class Util 5 | { 6 | public static IsStringNullOrEmpty(text: string): boolean 7 | { 8 | return (text === null || text === "" || typeof text === "undefined"); 9 | } 10 | 11 | public static FormatString(format: string, ...args: any[]): string 12 | { 13 | var result = format; 14 | for (var i = 0; i < args.length; i++) 15 | { 16 | var regex = new RegExp('\\{' + (i) + '\\}', 'gm'); 17 | result = result.replace(regex, args[i]); 18 | } 19 | 20 | return result; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/installer/step5.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web.Installer 3 | { 4 | export class Step5 5 | { 6 | private _wizard: InstallWizard; 7 | 8 | constructor(wizard: InstallWizard) 9 | { 10 | this._wizard = wizard; 11 | this._wizard.updateNavigation(5); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/directoryviewmodel.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web.FileManager 3 | { 4 | export interface DirectoryViewModel 5 | { 6 | status: string; 7 | message: string; 8 | Name: string; 9 | UrlPath: string; 10 | ChildFolders: DirectoryViewModel[]; 11 | Files: FileModel[]; 12 | } 13 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/filemanager.references.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/filemodel.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web.FileManager 3 | { 4 | export interface FileModel 5 | { 6 | Name: string; 7 | CreateDate: string; 8 | Extension: string; 9 | Size: number; 10 | } 11 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/installerconstants.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/installerconstants.js -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/installerconstants.ts: -------------------------------------------------------------------------------- 1 | declare var $ : any; 2 | declare var toastr : any; 3 | declare var bootbox : any; 4 | 5 | // 6 | // All variables below are copied from InstallerJsVars 7 | // and defined here to help Typescript compilation out. 8 | // 9 | 10 | declare var ROADKILL_INSTALLER_WOOPS; 11 | declare var ROADKILL_INSTALLER_TESTWEBCONFIG_URL; 12 | declare var ROADKILL_INSTALLER_TESTDATABASE_URL; 13 | declare var ROADKILL_INSTALLER_TESTLDAP_URL; 14 | declare var ROADKILL_INSTALLER_TESTATTACHMENTS_URL; -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/typescript-ref/references.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/Scripts/roadkill/validation.ts: -------------------------------------------------------------------------------- 1 | /// 2 | module Roadkill.Web 3 | { 4 | export class Validation 5 | { 6 | /* "rules" should be in the format: 7 | Configure({ 8 | fieldName : 9 | { required: true }, 10 | fieldName2 : 11 | { required: true } 12 | }); 13 | */ 14 | public Configure(formSelector: string, rules : any) 15 | { 16 | $.validator.messages = { 17 | required: ROADKILL_REQUIRED_FIELD 18 | }; 19 | 20 | $(formSelector).validate({ 21 | "rules" : rules, 22 | highlight: function (element) 23 | { 24 | $(element).closest('.form-group').addClass('has-error'); 25 | }, 26 | unhighlight: function (element) 27 | { 28 | $(element).closest('.form-group').removeClass('has-error'); 29 | }, 30 | errorElement: 'span', 31 | errorClass: 'help-block', 32 | errorPlacement: function (error, element) 33 | { 34 | if (element.parent('.input-group').length) 35 | { 36 | error.insertAfter(element.parent()); 37 | } else 38 | { 39 | error.insertAfter(element); 40 | } 41 | } 42 | }); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/opensearch.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | Roadkill 4 | Search the Roadkill wiki site 5 | Roadkill 6 | 7 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Assets/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/ClickableImages/clickableimages.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () 2 | { 3 | $("#pagecontent img").each(function() 4 | { 5 | var src = $(this).attr("src"); 6 | $(this).wrap(""); 7 | }); 8 | }); -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/ExternalLinksInNewWindow/ExternalLinksInNewWindow.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () 2 | { 3 | $("#pagecontent a.external-link").each(function () 4 | { 5 | $(this).attr("target","_blank"); 6 | }); 7 | }) -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/Jumbotron/jumbotron.css: -------------------------------------------------------------------------------- 1 | #roadkill-jumbotron { height: 700px; padding: 0px; margin: 0px; margin-bottom: 20px; border: 1px solid black; background-image: url(/Attachments/jumbotron.jpg); color: white; } 2 | #roadkill-jumbotron>#inner { text-align: center; margin-top: 50px; } 3 | #roadkill-jumbotron h1, 4 | #roadkill-jumbotron h2, 5 | #roadkill-jumbotron h3 { border:0px; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/ResizeImages/resizeimages.css: -------------------------------------------------------------------------------- 1 | #content img { max-width: 100%; vertical-align:middle;border:0; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/SyntaxHighlighter/javascript/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+.*$/gm, css: 'color2' }, 26 | { regex: /^\-\-\-.*$/gm, css: 'color2' }, 27 | { regex: /^\s.*$/gm, css: 'color1' }, 28 | { regex: /^@@.*@@$/gm, css: 'variable' }, 29 | { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, 30 | { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } 31 | ]; 32 | }; 33 | 34 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 35 | Brush.aliases = ['diff', 'patch']; 36 | 37 | SyntaxHighlighter.brushes.Diff = Brush; 38 | 39 | // CommonJS 40 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 41 | })(); 42 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/SyntaxHighlighter/javascript/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/Toc/toc.css: -------------------------------------------------------------------------------- 1 | /* Table of contents {TOC} */ 2 | .toc { border:1px solid #AAA; background-color:#F9F9F9; padding:5px;display:table;margin-bottom:15px; } 3 | .toc-title { font-weight:bold;text-align:center;min-width:100px; } 4 | .toc-showhide { font-weight:normal;font-size:0.8em; } 5 | .toc ul { list-style-type:none;padding:2px 5px;margin: 0px 0px 0px 1em;line-height:1.5em; } 6 | .toc-list>ul { margin:0px; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/Toc/toc.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () 2 | { 3 | // The show/hide for table of contents 4 | $("a.toc-showhide").click(function () 5 | { 6 | if ($(this).text() == "hide") 7 | { 8 | $(this).text("show"); 9 | } 10 | else 11 | { 12 | $(this).text("hide"); 13 | } 14 | 15 | $(this).parent().next().toggle(); 16 | }); 17 | }); -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Plugins/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @using Roadkill.Core.Configuration; 2 | @{ 3 | // This is a copy of the _ViewStart page found in /Views 4 | Roadkill.Core.Mvc.Controllers.ControllerBase controller = this.ViewContext.Controller as Roadkill.Core.Mvc.Controllers.ControllerBase; 5 | ApplicationSettings applicationSettings = controller.ApplicationSettings; 6 | 7 | if (applicationSettings.Installed) 8 | { 9 | SiteSettings siteSettings = controller.SettingsService.GetSiteSettings(); 10 | Layout = siteSettings.ThemePath + "/Theme.cshtml"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Roadkill.config: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Roadkill.dev.config: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/BlackBar/Theme.cshtml: -------------------------------------------------------------------------------- 1 | @inherits RoadkillLayoutPage 2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @Html.Partial("HeadContent") 8 | @RenderSection("PluginHead", false) 9 | 10 | 11 | @using (Html.BeginForm("Search", "Home", FormMethod.Get)) 12 | { 13 | 24 | } 25 | 26 |
27 | @RenderSection("PageToolbar", false) 28 | @RenderSection("PluginPreContainer", false) 29 | 30 |
31 | @RenderSection("ViewHistoryLink", false) 32 | @RenderBody() 33 | 34 | 37 |
38 | 39 | @RenderSection("PluginPostContainer", false) 40 | @RenderSection("PluginFooter", false) 41 |
42 | 43 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/BlackBar/Theme.print.css: -------------------------------------------------------------------------------- 1 | #viewhistory { display: none !important; } 2 | #toolbar { display: none !important; } 3 | #headfade { display: none !important; } 4 | #logo { display: none !important; } 5 | #panel { display: none !important; } 6 | #leftmenu { display: none !important; } 7 | #footer { display: none !important; } 8 | #container { border: 0px !important; margin-left: 0px !important; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/Theme.print.css: -------------------------------------------------------------------------------- 1 | #viewhistory { display: none !important; } 2 | #toolbar { display: none !important; } 3 | #headfade { display: none !important; } 4 | #logo { display: none !important; } 5 | #panel { display: none !important; } 6 | #leftmenu { display: none !important; } 7 | #footer { display: none !important; } 8 | #container { border: 0px !important; margin-left: 0px !important; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Themes/Mediawiki/border.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Themes/Mediawiki/logo.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/page-fade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Themes/Mediawiki/page-fade.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/pagebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Themes/Mediawiki/pagebg.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Mediawiki/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/roadkillwiki/roadkill/b0121aa316956d78f3ee14a86c8657722ca51739/src/Roadkill.Web/Themes/Mediawiki/search.png -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Plain/Theme.css: -------------------------------------------------------------------------------- 1 | #login-status { padding-bottom:10px; } 2 | div.search { float:right; } 3 | div.search span { color: navy; font-weight:bold } 4 | div#footer { border-top: 1px solid whitesmoke; margin-top: 50px;padding-top:10px; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Plain/Theme.print.css: -------------------------------------------------------------------------------- 1 | #viewhistory { display: none !important; } 2 | #toolbar { display: none !important; } 3 | #headfade { display: none !important; } 4 | #logo { display: none !important; } 5 | #panel { display: none !important; } 6 | #leftmenu { display: none !important; } 7 | #footer { display: none !important; } 8 | #container { border: 0px !important; margin-left: 0px !important; } -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Responsive/Theme.print.css: -------------------------------------------------------------------------------- 1 | #header-wrapper { display: none !important; } 2 | .searchbar { display: none !important; } 3 | .modal { display: none !important; } 4 | #top-link { display: none !important; } 5 | #viewhistory { display: none !important; } 6 | #powered-by { display: none !important; } 7 | #container { border: 0px !important; margin-left: 0px !important; } 8 | #toolbar { display: none !important; } 9 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Themes/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/FileManager/Navigator.cshtml: -------------------------------------------------------------------------------- 1 | @* The bool for the Model indicates whether to show the watermark or not *@ 2 | @model bool 3 | 4 | @if (Model) 5 | { 6 |
7 | 8 |
@SiteStrings.FileManager_Help
9 |
10 | } 11 | 12 |
13 | 14 |
15 | 16 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/FileManager/Select.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | @Url.JsBundle() 9 | @Url.CssBundle() 10 | @Url.BootstrapCSS() 11 | @Url.BootstrapJS() 12 | 13 | 14 | 15 | 18 | 19 | 20 |
21 |
22 | @Html.Partial("Navigator", false) 23 |
24 | 35 |
36 | 37 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Help/Index.cshtml: -------------------------------------------------------------------------------- 1 | 

Help:Cheatsheet

2 | @Html.Action(SiteSettings.MarkupType + "Reference", "Help") 3 | 4 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Install/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | Layout = "~/Views/Install/Layout.cshtml"; 4 | } 5 | 6 |
7 |

Choose a language:

8 |
    9 | @foreach (LanguageViewModel languageModel in Model) 10 | { 11 |
  • @Html.ActionLink(languageModel.Name, "Step1", new { language = languageModel.Code })
  • 12 | } 13 |
14 |
15 | 16 | @section BottomButtons 17 | { 18 | 19 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Install/InstallerJsVars.cshtml: -------------------------------------------------------------------------------- 1 | @using Roadkill.Core.Converters; 2 | @using Roadkill.Core.Configuration; 3 | @{Layout=null;} 4 | 5 | // Generated at: @DateTime.UtcNow.ToString() 6 | 7 | var ROADKILL_INSTALLER_WOOPS = "@SiteStrings.Shared_Unexpected_Error"; 8 | var ROADKILL_REQUIRED_FIELD = "@SiteStrings.SiteSettings_Configuration_Required_Field"; 9 | var ROADKILL_INSTALLER_TESTWEBCONFIG_URL = "@(Url.Action("TestWebConfig", "ConfigurationTester"))"; 10 | var ROADKILL_INSTALLER_TESTDATABASE_URL = "@(Url.Action("TestDatabaseConnection", "ConfigurationTester"))"; 11 | var ROADKILL_INSTALLER_TESTLDAP_URL = "@(Url.Action("TestLdap", "ConfigurationTester"))"; 12 | var ROADKILL_INSTALLER_TESTATTACHMENTS_URL = "@(Url.Action("TestAttachments", "ConfigurationTester"))"; -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Install/Step1.cshtml: -------------------------------------------------------------------------------- 1 | @model LanguageViewModel 2 | @{ 3 | Layout = "~/Views/Install/Layout.cshtml"; 4 | } 5 | @Url.InstallerScriptLink("step1.js") 6 | 22 | 23 |

24 | @InstallStrings.Step1_Intro 25 |

26 | 27 |

28 | @InstallStrings.Step1_WebConfig_Intro 29 |

30 | 31 | 34 | 35 | @section BottomButtons 36 | { 37 | 38 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/AllTags.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | ViewBag.Title = SiteStrings.AllTags_Title; 4 | } 5 |

@SiteStrings.AllTags_Title

6 | 7 | @if (Model.Count() > 0) 8 | { 9 |
    10 | @foreach (TagViewModel tag in Model) 11 | { 12 |
  • 13 | @Html.ActionLink(tag.Name,"Tag",new { id = tag }) 14 |
  • 15 | } 16 |
17 | } 18 | else 19 | { 20 |

@SiteStrings.AllTags_NoResults

21 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/Dialogs/ChooseImage.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/Dialogs/MarkupHelp.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/Dialogs/PreviewPage.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/Tag.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @{ 3 | string title = string.Format(SiteStrings.Pages_ForTag, ViewData["Tagname"]); 4 | ViewBag.Title = title; 5 | } 6 |

@title

7 | 8 | @if (Model.Count() > 0) 9 | { 10 | 11 | @foreach (PageViewModel pageModel in Model) 12 | { 13 | 14 | 15 | @if (RoadkillContext.IsLoggedIn) 16 | { 17 | 18 | } 19 | else 20 | { 21 | 22 | } 23 | 24 | } 25 |
@Html.ActionLink(pageModel.Title, "Index", "Wiki", new { id = pageModel.Id, title = pageModel.EncodedTitle }, null)@Html.ActionLink(SiteStrings.Shared_EditLink,"Edit",new { id = pageModel.Id}, new {@class = "btn btn-mini btn-primary" } )
26 | } 27 | else 28 | { 29 |

@string.Format(SiteStrings.Pages_ForTag_NoPages, ViewData["Tagname"])

30 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Pages/Version.cshtml: -------------------------------------------------------------------------------- 1 | @model PageViewModel 2 | @{ 3 | ViewBag.Title = string.Format(SiteStrings.Version_Title, Model.VersionNumber); 4 | } 5 | 6 | @Html.ActionLink("< " +SiteStrings.Version_BackLink,"History",new { id = Model.Id }) 7 |

@Model.Title

8 | 9 | 10 |
11 | @MvcHtmlString.Create(Model.Content) 12 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Shared/Dialogs/PageInformation.cshtml: -------------------------------------------------------------------------------- 1 | @model PageViewModel 2 | 3 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @inherits RoadkillViewPage 2 | @{ 3 | if (ApplicationSettings.Installed) 4 | { 5 | Layout = SiteSettings.ThemePath + "/Theme.cshtml"; 6 | } 7 | } 8 | 9 | 10 | 11 | Error 12 | 13 | 14 |

15 | Sorry, an error occurred while processing your request. 16 |

17 | 18 | @if (RoadkillContext.IsAdmin) 19 | { 20 |

An error occurred on @(Model.ControllerName).@Model.ActionName

21 | if (Model.Exception != null) 22 | { 23 |

@(Model.Exception.Message)

24 |
@Model.Exception.ToString()
25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Shared/HeadContent.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @Url.CssBundle() 5 | @Url.BootstrapCSS() 6 | @Url.JsBundle() 7 | @Url.BootstrapJS() 8 | 9 | 10 | @MvcHtmlString.Create(SiteSettings.HeadContent) 11 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Shared/TagBlocks.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @foreach (string tag in Model) 4 | { 5 | if (!string.IsNullOrWhiteSpace(tag)) 6 | { 7 | @Html.ActionLink(tag, "Tag", "Pages", new { id = tag }, null) 8 | } 9 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Shared/_Blank.cshtml: -------------------------------------------------------------------------------- 1 | @inherits RoadkillLayoutPage 2 | @using Roadkill.Core 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @Html.Partial("HeadContent") 8 | 9 | 10 | 11 | @RenderBody() 12 | 13 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/Activate.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = SiteStrings.Activate_Title; 3 | } 4 | 5 |

@SiteStrings.Activate_Title

6 | 7 |
8 |
9 |
10 | @Html.BootstrapValidationSummary(SiteStrings.Activate_Error_Title) 11 | 12 | @if (ViewData.ModelState.IsValid) 13 | { 14 |
15 |

@SiteStrings.Activate_Success_Title

16 | 17 |

18 | @SiteStrings.Activate_Label @Html.ActionLink(SiteStrings.Activate_Link, "Login") 19 |

20 |
21 | } 22 |
23 |
24 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/CompleteResetPasswordInvalid.cshtml: -------------------------------------------------------------------------------- 1 | @model UserViewModel 2 | @{ 3 | ViewBag.Title = SiteStrings.ResetPassword_Invalid_Title; 4 | } 5 | 6 |

@SiteStrings.ResetPassword_Invalid_Title

7 | 8 |
9 |
10 |
11 |
12 | @SiteStrings.ResetPassword_Invalid_Label 13 |
14 |
15 |
16 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/CompleteResetPasswordSuccessful.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | @{ 3 | ViewBag.Title = SiteStrings.ResetPassword_Successful_Title; 4 | } 5 | 6 |

@SiteStrings.ResetPassword_Successful_Title

7 | 8 |
9 |
10 |
11 |
12 | @SiteStrings.ResetPassword_Successful_Label 13 |
14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/LeftMenu.cshtml: -------------------------------------------------------------------------------- 1 | 
2 |
    3 |
  • @Html.MainPageLink(SiteStrings.Navigation_MainPage,"","")
  • 4 |
  • @Html.ActionLink(SiteStrings.Navigation_Categories, "AllTags", "Pages")
  • 5 |
  • @Html.ActionLink(SiteStrings.Navigation_AllPages, "AllPages", "Pages")
  • 6 |
7 | 8 | 9 | @if (RoadkillContext.IsLoggedIn) 10 | { 11 |
    12 |
  • @Html.NewPageLink("", "")
  • 13 |
  • @Html.FileManagerLink("","")
  • 14 | @Html.SettingsLink("
  • ", "
  • ") 15 |
16 | } 17 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/LoggedInAs.cshtml: -------------------------------------------------------------------------------- 1 | @Html.LoginStatus()@Html.LoginLink(" - ","") -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/Recaptcha.cshtml: -------------------------------------------------------------------------------- 1 | @model SiteSettings 2 | @{ 3 | Recaptcha.RecaptchaControl control = new Recaptcha.RecaptchaControl(); 4 | control.ID = "recaptcha"; 5 | control.Theme = "clean"; 6 | control.PublicKey = Model.RecaptchaPublicKey; 7 | control.PrivateKey = Model.RecaptchaPrivateKey; 8 | 9 | StringWriter stringWriter = new StringWriter(); 10 | HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter); 11 | control.RenderControl(htmlWriter); 12 | } 13 |
14 | 15 |
16 | @Html.Raw(htmlWriter.InnerWriter.ToString()) 17 |
18 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = SiteStrings.ResetPassword_Title; 3 | } 4 | 5 |

@SiteStrings.ResetPassword_Title

6 | 7 |
8 |
9 |
10 | @Html.BootstrapValidationSummary(SiteStrings.Shared_Error) 11 |

@SiteStrings.ResetPassword_Label

12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 |
20 | 21 |
22 | @Html.TextBox("email", null, new { @class = "form-control" }) 23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 |
34 |
35 |
36 |
-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/ResetPasswordSent.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | @{ 3 | ViewBag.Title = SiteStrings.ResetPassword_EmailSent_Title; 4 | } 5 | 6 |

@SiteStrings.ResetPassword_EmailSent_Title

7 |

8 | @string.Format(SiteStrings.ResetPassword_EmailSent_Label, Model) 9 |

-------------------------------------------------------------------------------- /src/Roadkill.Web/Views/User/SignupComplete.cshtml: -------------------------------------------------------------------------------- 1 | @model UserViewModel 2 | @{ 3 | ViewBag.Title = SiteStrings.Signup_Complete_Title; 4 | } 5 | 6 |

@SiteStrings.Signup_Complete_Title

7 | 8 |
9 |
10 |
11 |

@string.Format(SiteStrings.Signup_Complete_Label, Model.NewEmail)

12 | 13 | @if (TempData["resend"] != null) 14 | { 15 |
16 | @SiteStrings.Signup_Complete_EmailResent 17 |
18 | } 19 | 20 |

@SiteStrings.Signup_Complete_NoEmail

21 | @using (Html.BeginForm("ResendConfirmation", "User")) 22 | { 23 | @Html.Hidden("email", Model.NewEmail) 24 | 25 | } 26 |
27 |
28 |
29 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Wiki/404.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | if (ApplicationSettings.Installed) 3 | { 4 | Layout = SiteSettings.ThemePath + "/Theme.cshtml"; 5 | } 6 | } 7 | 8 | 9 | 10 | 404 not found 11 | 12 | 13 |

14 | 404 Not Found 15 |

16 | 17 |

18 | The page or resource you are looking for could be found on the server. 19 |

20 | 21 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Wiki/500.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | if (ApplicationSettings.Installed) 3 | { 4 | Layout = SiteSettings.ThemePath + "/Theme.cshtml"; 5 | } 6 | } 7 | 8 | 9 | 10 | 500 server error 11 | 12 | 13 |

14 | 500 server error 15 |

16 | 17 |

An error occurred on the server, and has been logged.

18 | 19 | @if (RoadkillContext.IsAdmin) 20 | { 21 |

Check the log files for the full error details

22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Wiki/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model PageViewModel 2 | @{ 3 | ViewBag.Title = Model.Title; 4 | } 5 | 6 | @section PageToolbar 7 | { 8 | @* This is rendered by an action (and not a partial/extension method) for future donut caching *@ 9 | @Html.Action("PageToolBar", "Wiki", new { id = Model.Id }) 10 | } 11 | 12 | @section ViewHistoryLink 13 | { 14 |
@Html.ActionLink(SiteStrings.Navigation_ViewHistory, "History", "Pages", new { id = Model.Id }, null)
15 | } 16 | 17 |

@Model.Title

18 | 19 |
20 | @MvcHtmlString.Create(Model.ContentAsHtml) 21 |
22 | 23 | @section PageDetailsFooter 24 | { 25 | @SiteStrings.Shared_LastModified @Model.ModifiedOnWithOffset. 26 | } 27 | 28 | @section PluginHead 29 | { 30 | 31 | @Html.Raw(Model.PluginHeadHtml) 32 | } 33 | 34 | @section PluginPreContainer 35 | { 36 | @MvcHtmlString.Create(Model.PluginPreContainer) 37 | } 38 | 39 | @section PluginPostContainer 40 | { 41 | @MvcHtmlString.Create(Model.PluginPostContainer) 42 | } 43 | 44 | @section PluginFooter 45 | { 46 | @MvcHtmlString.Create(Model.PluginFooterHtml) 47 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/Wiki/PageToolbar.cshtml: -------------------------------------------------------------------------------- 1 | @model PageViewModel 2 | 3 | @if (Model.Id != 0) 4 | { 5 |
6 |
7 | @if (RoadkillContext.IsLoggedIn) 8 | { 9 | if (Model.IsLocked && !RoadkillContext.IsAdmin) 10 | { 11 | 12 | } 13 | else 14 | { 15 | 16 | } 17 | } 18 | 19 |
20 |
21 | 22 | @Html.DialogPartial("PageInformation", Model) 23 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @using Roadkill.Core.Configuration; 2 | @{ 3 | // ViewStart does not inherit from the RoadkillView, as it's outside of MVC (it's the ASP.NET Masterpage system). So get the controller from context instead. 4 | // When changing this file, change the one in the SiteSettings Area too. 5 | var controller = this.ViewContext.Controller as IRoadkillController; 6 | ApplicationSettings applicationSettings = controller.ApplicationSettings; 7 | 8 | if (applicationSettings.Installed) 9 | { 10 | SiteSettings siteSettings = controller.SettingsService.GetSiteSettings(); 11 | Layout = siteSettings.ThemePath + "/Theme.cshtml"; 12 | } 13 | } -------------------------------------------------------------------------------- /src/Roadkill.Web/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Roadkill.Web/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Roadkill.Web/connectionStrings.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Roadkill.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.275", 3 | "name": "Roadkill", 4 | "private": false, 5 | "dependencies": { }, 6 | "devDependencies": { 7 | "bower": "^1.6.5", 8 | "grunt": "^0.4.5", 9 | "grunt-bower-task": "^0.4.0", 10 | "grunt-cli": "^0.1.13", 11 | "grunt-contrib-sass": "^0.9.2", 12 | "grunt-contrib-clean": "^0.7.0", 13 | "grunt-contrib-concat": "^0.5.1", 14 | "grunt-contrib-uglify": "^0.11.0" 15 | }, 16 | "engines": { 17 | "node": ">=0.6" 18 | } 19 | } --------------------------------------------------------------------------------