Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hacki11 committed Mar 14, 2021
0 parents commit 8baadac
Show file tree
Hide file tree
Showing 40 changed files with 13,018 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .create-adapter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"cli": true,
"adapterName": "speedport",
"title": "Speedport",
"description": "Fetches data from Telekom Speedport Router",
"keywords": [
"speedport telekom"
],
"expert": "yes",
"features": [
"adapter"
],
"adminFeatures": [],
"type": "infrastructure",
"startMode": "daemon",
"connectionType": "local",
"dataSource": "poll",
"connectionIndicator": "yes",
"language": "JavaScript",
"adminReact": "no",
"tools": [
"ESLint",
"type checking",
"devcontainer"
],
"indentation": "Space (4)",
"quotes": "double",
"es6class": "yes",
"authorName": "hacki11",
"authorGithub": "hacki11",
"authorEmail": "[email protected]",
"gitRemoteProtocol": "SSH",
"gitCommit": "yes",
"license": "MIT License",
"ci": "gh-actions",
"dependabot": "yes",
"creatorVersion": "1.32.0"
}
4 changes: 4 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Devcontainer readme
This directory allows you to develop your adapter in a dedicated Docker container. To get started and for requirements, please read the getting started section at https://code.visualstudio.com/docs/remote/containers#_getting-started

Once you're done with that, VSCode will prompt you to reopen the adapter directory in a container. This takes a while, afterwards you can access the admin UI at http://localhost:8082. To change that port, edit `docker-compose.yml` to have a different `ports` configuration for `nginx`.
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "ioBroker Docker Compose",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [ "docker-compose.yml" ],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "iobroker",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": ["dbaeumer.vscode-eslint"],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// When creating the container, delete unnecessary adapters, disable error reporting, set the license as confirmed, and install/update this adapter
"postCreateCommand": "iob del discovery && iob plugin disable sentry && iob object set system.config common.licenseConfirmed=true && NPM_PACK=$(npm pack) && iob url \"$(pwd)/$NPM_PACK\" --debug && rm \"$NPM_PACK\""

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
//"remoteUser": "iobroker"
}
37 changes: 37 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3'

services:
iobroker:
build: ./iobroker
container_name: iobroker-speedport
hostname: iobroker-speedport
# This port is only internal, so we can work on this while another instance of ioBroker is running on the host
expose:
- 8081
volumes:
- ..:/workspace:cached
- iobrokerdata-speedport:/opt/iobroker
environment:
- LANG=en_US.UTF-8
- LANGUAGE=en_US:en
- LC_ALL=en_US.UTF-8
- TZ=Europe/Berlin
- SETGID=1000

# Reverse proxy to load up-to-date admin sources from the repo
nginx:
image: nginx:latest
depends_on:
- iobroker
links:
- iobroker
container_name: nginx-speedport
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ..:/workspace:cached
ports:
# Make the ioBroker admin available under http://localhost:8082
- 8082:80

volumes:
iobrokerdata-speedport:
2 changes: 2 additions & 0 deletions .devcontainer/iobroker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM buanet/iobroker:latest
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
28 changes: 28 additions & 0 deletions .devcontainer/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
worker_processes 1;
events { worker_connections 1024; }

http {
sendfile on;
keepalive_timeout 65;

server {
listen 80;

location / {
proxy_redirect off;
proxy_pass http://iobroker:8081;
}

location /socket.io/ {
proxy_pass http://iobroker:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}

location /adapter/speedport/ {
alias /workspace/admin/;
}

}
}
40 changes: 40 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"root": true,
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"plugins": [],
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-console": "off",
"no-var": "error",
"no-trailing-spaces": "error",
"prefer-const": "error",
"quotes": [
"error",
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": [
"error",
"always"
]
},
"parserOptions": {
"ecmaVersion": 2018
}
}
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Something is not working as it should
title: ''
labels: ''
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots & Logfiles**
If applicable, add screenshots and logfiles to help explain your problem.

**Versions:**
- Adapter version: <adapter-version>
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
- Operating system: <os-name>

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configure here which dependency updates should be merged automatically.
# The recommended configuration is the following:
- match:
# Only merge patches for production dependencies
dependency_type: production
update_type: "semver:patch"
- match:
# Except for security fixes, here we allow minor patches
dependency_type: production
update_type: "security:minor"
- match:
# and development dependencies can have a minor update, too
dependency_type: development
update_type: "semver:minor"

# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
# https://dependabot.com/docs/config-file/#automerged_updates
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
assignees:
- hacki11
versioning-strategy: increase
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Automatically merge Dependabot PRs when version comparison is within the range
# that is configured in .github/auto-merge.yml

name: Auto-Merge Dependabot PRs

on:
pull_request:

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check if PR should be auto-merged
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
# This must be a personal access token with push access
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
# By default, squash and merge, so Github chooses nice commit messages
command: squash and merge
Loading

0 comments on commit 8baadac

Please sign in to comment.