Skip to content

Commit

Permalink
Merge branch 'master' into release-0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fr-ser committed Jan 7, 2021
2 parents 9b890e4 + ac5a069 commit e3890fc
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 18 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [0.2.7]

### Changed

- Changing plugin name to SQLite

- added category to plugin.json for better grouping on the Grafana homepage

- updated Readme after first official release of plugin on Grafana homepage

## [0.2.6]

### Added
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,35 @@ Any contribution is welcome. Some information regarding the local setup can be f
The most up to date (but also most generic) information can always be found here:
[Grafana Website - Plugin Installation](https://grafana.com/docs/grafana/latest/plugins/installation/#install-grafana-plugins)

### ~~Installing the Plugin on an Existing Grafana with the CLI (not released yet)~~
### Installing the Plugin on an Existing Grafana with the CLI

~~Grafana comes with a command line tool that can be used to install plugins.~~
Grafana comes with a command line tool that can be used to install plugins.

1. ~~Run this command: `grafana-cli plugins install frser-sqlite-datasource`~~
2. ~~Restart the Grafana server.~~
3. ~~Login in with a user that has admin rights. This is needed to create datasources.~~
4. ~~To make sure the plugin was installed, check the list of installed datasources. Click the
Plugins item in the main menu. Both core datasources and installed datasources will appear.~~
1. Run this command: `grafana-cli plugins install frser-sqlite-datasource`
2. Restart the Grafana server.
3. Login in with a user that has admin rights. This is needed to create datasources.
4. To make sure the plugin was installed, check the list of installed datasources. Click the
Plugins item in the main menu. Both core datasources and installed datasources will appear.

### Installing the Plugin Manually on an Existing Grafana
### Installing the Plugin Manually on an Existing Grafana (most up to date)

If the server where Grafana is installed has no access to the Grafana.com server, then the plugin can be downloaded and manually copied to the server.
If you need a version that is not released (yet) on the Grafana homepage or if the server where
Grafana is installed has no access to the Grafana.com server, then the plugin can be downloaded
and manually copied to the server.

1. Get the zip file from [Latest release on Github](https://github.com/fr-ser/grafana-sqlite-datasource/releases/latest)
2. Extract the zip file into the data/plugins subdirectory for Grafana:
`unzip the_downloaded_file.zip -d YOUR_PLUGIN_DIR/frser-sqlite-datasource`
3. Restart the Grafana server
4. To make sure the plugin was installed, check the list of installed datasources. Click the Plugins item in the main menu. Both core datasources and installed datasources will appear.
4. To make sure the plugin was installed, check the list of installed datasources. Click the
Plugins item in the main menu. Both core datasources and installed datasources will appear.

### ARM6 / RaspberryPi Zero W support

This plugins supports ARM6 (the version running on RaspberryPi Zero W). There is a problem, though,
with Grafana supporting ARM7 (newer Raspberries) and ARM6 at the same time. Grafana chooses
the correct plugin by file name. But both ARM6 and ARM7 are named
`<plugin_dir>/frser-sqlite-datasource/dist/gpx_sqlite-datasource_linux_arm`.
`<plugin_dir>/frser-sqlite-datasource/gpx_sqlite-datasource_linux_arm`.

Currently the ARM7 build is named like this by default, which is why the "official" plugin
distribution does not support ARM6 devices.
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
- "./dist:/var/lib/grafana/plugins/frser-sqlite-datasource"
ports:
- 3000:3000
depends_on:
- postgres
selenium:
image: selenium/standalone-chrome:84.0
shm_size: 2gb
Expand All @@ -26,3 +28,10 @@ services:
- grafana
- selenium
command: grafana:3000 selenium:4444
postgres:
# used to compare the sqlite plugin
image: postgres:12-alpine
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=changed_later
- POSTGRES_DB=db_name
17 changes: 16 additions & 1 deletion grafana_config/datasource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ datasources:
isDefault: true
editable: true
jsonData:
path: /app/data.db
path: /app/data.db
- name: postgres
type: postgres
access: proxy
url: postgres:5432
user: admin
database: db_name
isDefault: false
editable: true
jsonData:
postgresVersion: 1200
timescaledb: false
maxOpenConns: 5
sslmode: "disable"
secureJsonData:
password: changed_later
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frser-sqlite-datasource",
"version": "0.2.6",
"version": "0.2.7",
"description": "SQLite as a (Backend) Datasource",
"scripts": {
"build": "grafana-toolkit plugin:build",
Expand Down
4 changes: 1 addition & 3 deletions selenium/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ describe('configure', () => {
it('configures the plugin', async () => {
await driver.get(`${GRAFANA_URL}/datasources/new`);
await driver.wait(until.elementLocated(By.css('div.add-data-source-category')), 5 * 1000);
await driver
.findElement(By.css("div.add-data-source-item[aria-label='Data source plugin item sqlite-datasource']"))
.click();
await driver.findElement(By.css("div.add-data-source-item[aria-label='Data source plugin item SQLite']")).click();

await driver.wait(
until.elementLocated(By.css("input[placeholder='(absolute) path to the SQLite database']")),
Expand Down
5 changes: 3 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"type": "datasource",
"name": "sqlite-datasource",
"name": "SQLite",
"id": "frser-sqlite-datasource",
"metrics": true,
"backend": true,
"category": "sql",
"executable": "gpx_sqlite-datasource",
"info": {
"description": "SQLite as a (Backend) Datasource",
"author": {
"name": "Sergej Herbert",
"url": "https://github.com/fr-ser"
},
"keywords": ["sqlite"],
"keywords": ["sqlite", "sql"],
"logos": {
"small": "img/logo.svg",
"large": "img/logo.svg"
Expand Down

0 comments on commit e3890fc

Please sign in to comment.