1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/saving/Saving to a Git service.tid
Bimba Laszlo b5653babdf Add GitLab saver, apply common lingo to Git savers (#3931)
* Transform GitHub saver to work with GitLab as well

You can choose which provider you want to use, the data is given in the
same place.

I tried to avoid code duplication, so service providers' unique
properties are in separate files, the settings of the selected provider
are loaded.

In two fields I am not sure that it fits into the current structure:

* module-type: gitservice
  Which module is a `gitservice` type, it will be listed in the
  drop-down menu.
* default-api-url: https://gitlab.com/api/v4
  The default URL to access the provider's API.

This is just a sketch, not a final version, suggestions for modification
are welcome!

* Rename saver from GitHub to GitService, update docs

* Split GitHub and GitLab to separate savers, apply common lingo

Sadly, it doesn't seem to make much sense to search for common parts in
the code, because there might be a Git service that is very different
from the GitHub API (such as BitBucket). Therefore, I feel that Git
savers are not able to share other than the translations.

I deleted the defaults values from the translations and set it to the
text entry because they should not depend on the translations.

* Add more information about the password field

It is not clear how to create a personal access token, thus added a link
to the help pages. In addition, GitLab only accepts personal access
token, GitHub also accepts the password, so I made this clear.

* Extract commit message to lingo

* Fix indentation

* Use improved base64 encoder

Fix conflict with a06acc4eb8
2019-07-31 21:38:52 +01:00

26 lines
1.7 KiB
Plaintext

created: 20190408173002622
modified: 20190408173002622
tags: Saving Android Chrome Firefox InternetExplorer iOS Linux Mac Opera Safari Windows
title: Saving to a Git service
type: text/vnd.tiddlywiki
delivery: Service
method: save
caption: Git Service Saver
description: Save changes directly to a Git repository (on GitHub, GitLab)
TiddlyWiki can save changes directly to a GitHub repository in the single file configuration.
Saving to a Git service is configured in the [[$:/ControlPanel]] in the ''Git Service Saver'' tab under the ''Saving'' tab. The following settings are supported:
* ''Type'' - (mandatory) the type of the service (e.g. GitHub, GitLab)
* ''Username'' - (mandatory) the username for the Git service account used for saving changes
* ''Password'' - (mandatory) the password, OAUTH token or personal access token for the specified account. Note that GitHub permits [[several different mechanisms|https://developer.github.com/v3/#authentication]] for authentication
* ''Repository'' - (mandatory) the name of the Git repository. Both the owner name and the repository name must be specified. For example `Jermolene/TiddlyWiki5`
* ''Branch'' - (optional) the name of the branch to be used within the Git repository. Defaults to `master`
* ''Path'' - (optional) the path to the target file. Defaults to `/`
* ''Filename'' - (mandatory) the filename of the target file
Notes
* The Git service password is stored persistently in browser local storage. Be sure to clear the password if using a shared machine. Using a [[personal access token|]] for authentication offers an extra layer of security: if the access token is accidentally exposed it can be revoked without needing to reset the account password