diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 41de69abe8..ea42793df7 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -138,13 +138,22 @@ getFirstRepositoryR :: Handler RepHtml getFirstRepositoryR = postFirstRepositoryR postFirstRepositoryR :: Handler RepHtml postFirstRepositoryR = page "Getting started" (Just Configuration) $ do +#ifdef __ANDROID__ + androidspecial <- liftIO $ doesDirectoryExist "/sdcard/DCIM" + let path = "/sdcard/annex" +#else + let androidspecial = False path <- liftIO . defaultRepositoryPath =<< lift inFirstRun +#endif ((res, form), enctype) <- lift $ runFormPost $ newRepositoryForm path case res of FormSuccess (RepositoryPath p) -> lift $ - startFullAssistant $ T.unpack p + startFullAssistant (T.unpack p) ClientGroup _ -> $(widgetFile "configurators/newrepository/first") +getAndroidCameraRepositoryR :: Handler () +getAndroidCameraRepositoryR = startFullAssistant "/sdcard/DCIM" SourceGroup + {- Adding a new local repository, which may be entirely separate, or may - be connected to the current repository. -} getNewRepositoryR :: Handler RepHtml @@ -299,14 +308,13 @@ driveList = return [] {- Bootstraps from first run mode to a fully running assistant in a - repository, by running the postFirstRun callback, which returns the - url to the new webapp. -} -startFullAssistant :: FilePath -> Handler () -startFullAssistant path = do +startFullAssistant :: FilePath -> StandardGroup -> Handler () +startFullAssistant path group = do webapp <- getYesod url <- liftIO $ do isnew <- makeRepo path False u <- initRepo isnew True path Nothing - inDir path $ - setStandardGroup u ClientGroup + inDir path $ setStandardGroup u group addAutoStartFile path changeWorkingDirectory path fromJust $ postFirstRun webapp diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index bae66078fa..831d879814 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -21,8 +21,9 @@ /config/xmpp/needcloudrepo/#UUID NeedCloudRepoR GET /config/addrepository AddRepositoryR GET -/config/repository/new/first FirstRepositoryR GET POST /config/repository/new NewRepositoryR GET POST +/config/repository/new/first FirstRepositoryR GET POST +/config/repository/new/androidcamera AndroidCameraRepositoryR GET /config/repository/switcher RepositorySwitcherR GET /config/repository/switchto/#FilePath SwitchToRepositoryR GET /config/repository/combine/#FilePathAndUUID CombineRepositoryR GET diff --git a/doc/Android.mdwn b/doc/Android.mdwn index 8bf582b271..5d6e74ef7c 100644 --- a/doc/Android.mdwn +++ b/doc/Android.mdwn @@ -12,22 +12,6 @@ webapp. [[!toc ]] -## using the webapp - -You can use the webapp on Android much the same as on any other -operating system, to set up the git-annex assistant. - -The repository created by the webapp on your Android device is configured, -by default, as a "source" repository. This way, when you create a file on -Android (by, for example, taking a picture), it will be uploaded from your -Android device, and then its content removed from the device. This saves -storage space. - -If you want to send files to your Android, and use them there, you should -edit the repository's configuration, and select "client". Bear in mind that -this will make it try to get every file placed in your repository on any -other computer, which might take up a lot of space. - ## closing and reopening the webapp The webapp does not need to be left open after you've set up your diff --git a/doc/design/assistant/android.mdwn b/doc/design/assistant/android.mdwn index a63c88c2a9..6b3b4cbc55 100644 --- a/doc/design/assistant/android.mdwn +++ b/doc/design/assistant/android.mdwn @@ -23,3 +23,11 @@ jobs when low on battery or run flat out when plugged in. * The app should be aware of network status, and avoid expensive data transfers when not on wifi. This may need to be configurable. +* Jabber and Webdav configuration both fail with + "getProtocolByname: does not exist (no such protocol name: tcp)" +* Ssh server and Rsync.net configuration stops where ssh + should be prompting for a password in the terminal. +* Enabling debug logging in the webapp doesn't seem to work. +* S3, glacier, and local pairing are not yet enabled for Android. +* The "Files" link doesn't start a file browser. Should be possible to do + on Android via intents, I suppose? diff --git a/templates/configurators/newrepository/first.hamlet b/templates/configurators/newrepository/first.hamlet index 4c189b761b..062a5fdd49 100644 --- a/templates/configurators/newrepository/first.hamlet +++ b/templates/configurators/newrepository/first.hamlet @@ -3,9 +3,17 @@ Welcome to git-annex!
To get started, let's create a git-annex repository. + $if androidspecial +
+ Do you only want to share photos and videos you take? +