GHP publish
This commit is contained in:
commit
380dbf855f
21
build.yaml
Normal file
21
build.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
|
tasks:
|
||||||
|
- name: Find all dirs
|
||||||
|
find:
|
||||||
|
paths: .
|
||||||
|
file_type: directory
|
||||||
|
recurse: false
|
||||||
|
register: dirs
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ item.path }}"
|
||||||
|
loop: "{{ dirs.files }}"
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
community.general.make:
|
||||||
|
chdir: "{{ item }}"
|
||||||
|
target: "{{ target | default('all') }}"
|
||||||
|
params:
|
||||||
|
REGISTRY: "{{ registry | default('registry.0xace.cc') }}"
|
||||||
|
loop: "{{ dirs.files | map(attribute='path') | list }}"
|
6
ddclient/.dockerignore
Normal file
6
ddclient/.dockerignore
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.github
|
||||||
|
.gitattributes
|
||||||
|
READMETEMPLATE.md
|
||||||
|
README.md
|
17
ddclient/.gitattributes
vendored
Normal file
17
ddclient/.gitattributes
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Custom for Visual Studio
|
||||||
|
*.cs diff=csharp
|
||||||
|
|
||||||
|
# Standard to msysgit
|
||||||
|
*.doc diff=astextplain
|
||||||
|
*.DOC diff=astextplain
|
||||||
|
*.docx diff=astextplain
|
||||||
|
*.DOCX diff=astextplain
|
||||||
|
*.dot diff=astextplain
|
||||||
|
*.DOT diff=astextplain
|
||||||
|
*.pdf diff=astextplain
|
||||||
|
*.PDF diff=astextplain
|
||||||
|
*.rtf diff=astextplain
|
||||||
|
*.RTF diff=astextplain
|
122
ddclient/.github/CONTRIBUTING.md
vendored
Executable file
122
ddclient/.github/CONTRIBUTING.md
vendored
Executable file
@ -0,0 +1,122 @@
|
|||||||
|
# Contributing to ddclient
|
||||||
|
|
||||||
|
## Gotchas
|
||||||
|
|
||||||
|
* While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open.
|
||||||
|
* Read, and fill the Pull Request template
|
||||||
|
* If this is a fix for a typo in code or documentation in the README please file an issue
|
||||||
|
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
|
||||||
|
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
|
||||||
|
|
||||||
|
## Common files
|
||||||
|
|
||||||
|
| File | Use case |
|
||||||
|
| :----: | --- |
|
||||||
|
| `Dockerfile` | Dockerfile used to build amd64 images |
|
||||||
|
| `Dockerfile.aarch64` | Dockerfile used to build 64bit ARM architectures |
|
||||||
|
| `Dockerfile.armhf` | Dockerfile used to build 32bit ARM architectures |
|
||||||
|
| `Jenkinsfile` | This file is a product of our builder and should not be edited directly. This is used to build the image |
|
||||||
|
| `jenkins-vars.yml` | This file is used to generate the `Jenkinsfile` mentioned above, it only affects the build-process |
|
||||||
|
| `package_versions.txt` | This file is generated as a part of the build-process and should not be edited directly. It lists all the installed packages and their versions |
|
||||||
|
| `README.md` | This file is a product of our builder and should not be edited directly. This displays the readme for the repository and image registries |
|
||||||
|
| `readme-vars.yml` | This file is used to generate the `README.md` |
|
||||||
|
|
||||||
|
## Readme
|
||||||
|
|
||||||
|
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
|
||||||
|
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-ddclient/edit/master/readme-vars.yml).
|
||||||
|
|
||||||
|
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
|
||||||
|
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-ddclient)
|
||||||
|
|
||||||
|
### Fixing typos or clarify the text in the readme
|
||||||
|
|
||||||
|
There are variables for multiple parts of the readme, the most common ones are:
|
||||||
|
|
||||||
|
| Variable | Description |
|
||||||
|
| :----: | --- |
|
||||||
|
| `project_blurb` | This is the short excerpt shown above the project logo. |
|
||||||
|
| `app_setup_block` | This is the text that shows up under "Application Setup" if enabled |
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
The compose and run examples are also generated from these variables.
|
||||||
|
|
||||||
|
We have a [reference file](https://github.com/linuxserver/docker-jenkins-builder/blob/master/vars/_container-vars-blank) in our Jenkins Builder.
|
||||||
|
|
||||||
|
These are prefixed with `param_` for required parameters, or `opt_param` for optional parameters, except for `cap_add`.
|
||||||
|
Remember to enable param, if currently disabled. This differs between parameters, and can be seen in the reference file.
|
||||||
|
|
||||||
|
Devices, environment variables, ports and volumes expects its variables in a certain way.
|
||||||
|
|
||||||
|
### Devices
|
||||||
|
|
||||||
|
```yml
|
||||||
|
param_devices:
|
||||||
|
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
|
||||||
|
opt_param_devices:
|
||||||
|
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" }
|
||||||
|
```
|
||||||
|
|
||||||
|
### Environment variables
|
||||||
|
|
||||||
|
```yml
|
||||||
|
param_env_vars:
|
||||||
|
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
|
||||||
|
opt_param_env_vars:
|
||||||
|
- { env_var: "VERSION", env_value: "latest", desc: "Supported values are LATEST, PLEXPASS or a specific version number." }
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ports
|
||||||
|
|
||||||
|
```yml
|
||||||
|
param_ports:
|
||||||
|
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
|
||||||
|
opt_param_ports:
|
||||||
|
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
|
||||||
|
```
|
||||||
|
|
||||||
|
### Volumes
|
||||||
|
|
||||||
|
```yml
|
||||||
|
param_volumes:
|
||||||
|
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
|
||||||
|
opt_param_volumes:
|
||||||
|
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
|
||||||
|
```
|
||||||
|
|
||||||
|
### Testing template changes
|
||||||
|
|
||||||
|
After you make any changes to the templates, you can use our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) to have the files updated from the modified templates. Please use the command found under `Running Locally` [on this page](https://github.com/linuxserver/docker-jenkins-builder/blob/master/README.md) to generate them prior to submitting a PR.
|
||||||
|
|
||||||
|
## Dockerfiles
|
||||||
|
|
||||||
|
We use multiple Dockerfiles in our repos, this is because sometimes some CPU architectures needs different packages to work.
|
||||||
|
If you are proposing additional packages to be added, ensure that you added the packages to all the Dockerfiles in alphabetical order.
|
||||||
|
|
||||||
|
### Testing your changes
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/linuxserver/docker-ddclient.git
|
||||||
|
cd docker-ddclient
|
||||||
|
docker build \
|
||||||
|
--no-cache \
|
||||||
|
--pull \
|
||||||
|
-t linuxserver/ddclient:latest .
|
||||||
|
```
|
||||||
|
|
||||||
|
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
||||||
|
```
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||||
|
```
|
||||||
|
|
||||||
|
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||||
|
|
||||||
|
## Update the chagelog
|
||||||
|
|
||||||
|
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-ddclient/tree/master/root), add an entry to the changelog
|
||||||
|
|
||||||
|
```yml
|
||||||
|
changelogs:
|
||||||
|
- { date: "DD.MM.YY:", desc: "Added some love to templates" }
|
||||||
|
```
|
2
ddclient/.github/FUNDING.yml
vendored
Executable file
2
ddclient/.github/FUNDING.yml
vendored
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
github: linuxserver
|
||||||
|
open_collective: linuxserver
|
38
ddclient/.github/ISSUE_TEMPLATE.md
vendored
Normal file
38
ddclient/.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
|
||||||
|
|
||||||
|
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
|
||||||
|
|
||||||
|
<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from --->
|
||||||
|
<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
<!--- Tell us what should happen -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
<!--- Tell us what happens instead of the expected behavior -->
|
||||||
|
|
||||||
|
## Steps to Reproduce
|
||||||
|
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||||
|
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
4.
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
**OS:**
|
||||||
|
**CPU architecture:** x86_64/arm32/arm64
|
||||||
|
**How docker service was installed:**
|
||||||
|
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
|
||||||
|
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||||
|
|
||||||
|
## Command used to create docker container (run/create/compose/screenshot)
|
||||||
|
<!--- Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container -->
|
||||||
|
|
||||||
|
## Docker logs
|
||||||
|
<!--- Provide a full docker log, output of "docker logs ddclient" -->
|
43
ddclient/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
43
ddclient/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<!--- Provide a general summary of your changes in the Title above -->
|
||||||
|
|
||||||
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
|
||||||
|
|
||||||
|
|
||||||
|
<!--- Before submitting a pull request please check the following -->
|
||||||
|
|
||||||
|
<!--- If this is a fix for a typo in code or documentation in the README please file an issue and let us sort it out we do not need a PR -->
|
||||||
|
<!--- Ask yourself if this modification is something the whole userbase will benefit from, if this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
|
||||||
|
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
|
||||||
|
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->
|
||||||
|
<!--- We maintain a changelog of major revisions to the container at the end of readme-vars.yml in the root of this repository, please add your changes there if appropriate -->
|
||||||
|
|
||||||
|
|
||||||
|
<!--- Coding guidelines: -->
|
||||||
|
<!--- 1. Installed packages in the Dockerfiles should be in alphabetical order -->
|
||||||
|
<!--- 2. Changes to Dockerfile should be replicated in Dockerfile.armhf and Dockerfile.aarch64 if applicable -->
|
||||||
|
<!--- 3. Indentation style (tabs vs 4 spaces vs 1 space) should match the rest of the document -->
|
||||||
|
<!--- 4. Readme is auto generated from readme-vars.yml, make your changes there -->
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-ddclient/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
<!--- We welcome all PR’s though this doesn’t guarantee it will be accepted. -->
|
||||||
|
|
||||||
|
## Description:
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Benefits of this PR and context:
|
||||||
|
<!--- Please explain why we should accept this PR. If this fixes an outstanding bug, please reference the issue # -->
|
||||||
|
|
||||||
|
## How Has This Been Tested?
|
||||||
|
<!--- Please describe in detail how you tested your changes. -->
|
||||||
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||||
|
<!--- see how your change affects other areas of the code, etc. -->
|
||||||
|
|
||||||
|
|
||||||
|
## Source / References:
|
||||||
|
<!--- Please include any forum posts/github links relevant to the PR -->
|
13
ddclient/.github/workflows/greetings.yml
vendored
Executable file
13
ddclient/.github/workflows/greetings.yml
vendored
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
name: Greetings
|
||||||
|
|
||||||
|
on: [pull_request_target, issues]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
greeting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/first-interaction@v1
|
||||||
|
with:
|
||||||
|
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-ddclient/blob/master/.github/ISSUE_TEMPLATE.md)!'
|
||||||
|
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-ddclient/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
23
ddclient/.github/workflows/stale.yml
vendored
Executable file
23
ddclient/.github/workflows/stale.yml
vendored
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
name: Mark stale issues and pull requests
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 1 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v1
|
||||||
|
with:
|
||||||
|
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
|
||||||
|
stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
|
||||||
|
stale-issue-label: 'no-issue-activity'
|
||||||
|
stale-pr-label: 'no-pr-activity'
|
||||||
|
days-before-stale: 30
|
||||||
|
days-before-close: 365
|
||||||
|
exempt-issue-labels: 'awaiting-approval,work-in-progress'
|
||||||
|
exempt-pr-labels: 'awaiting-approval,work-in-progress'
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
43
ddclient/.gitignore
vendored
Normal file
43
ddclient/.gitignore
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Operating System Files
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
# OSX
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear on external disk
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
62
ddclient/Dockerfile
Normal file
62
ddclient/Dockerfile
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.12
|
||||||
|
|
||||||
|
# set version label
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG VERSION
|
||||||
|
ARG DDCLIENT_VERSION
|
||||||
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
|
LABEL maintainer="saarg"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk add --no-cache --virtual=build-dependencies \
|
||||||
|
bzip2 \
|
||||||
|
gcc \
|
||||||
|
make \
|
||||||
|
tar \
|
||||||
|
wget && \
|
||||||
|
echo "**** install runtime packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
inotify-tools \
|
||||||
|
jq \
|
||||||
|
perl \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-io-socket-inet6 \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-json && \
|
||||||
|
echo "***** install perl modules ****" && \
|
||||||
|
curl -L http://cpanmin.us | perl - App::cpanminus && \
|
||||||
|
cpanm \
|
||||||
|
Data::Validate::IP \
|
||||||
|
JSON::Any && \
|
||||||
|
echo "**** install nsupdate for RFC2136 ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
bind-tools && \
|
||||||
|
echo "**** install ddclient ****" && \
|
||||||
|
if [ -z ${DDCLIENT_VERSION+x} ]; then \
|
||||||
|
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
|
||||||
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||||
|
fi && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/ddclient && \
|
||||||
|
curl -o \
|
||||||
|
/tmp/ddclient.tar.gz -L \
|
||||||
|
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
|
||||||
|
tar xf \
|
||||||
|
/tmp/ddclient.tar.gz -C \
|
||||||
|
/tmp/ddclient --strip-components=1 && \
|
||||||
|
install -Dm755 /tmp/ddclient/ddclient /usr/bin/ && \
|
||||||
|
echo "**** cleanup ****" && \
|
||||||
|
apk del --purge \
|
||||||
|
build-dependencies && \
|
||||||
|
rm -rf \
|
||||||
|
/config/.cpanm \
|
||||||
|
/root/.cpanm \
|
||||||
|
/tmp/*
|
||||||
|
|
||||||
|
# copy local files
|
||||||
|
COPY root/ /
|
||||||
|
|
||||||
|
# ports and volumes
|
||||||
|
VOLUME /config
|
59
ddclient/Dockerfile.aarch64
Normal file
59
ddclient/Dockerfile.aarch64
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.12
|
||||||
|
|
||||||
|
# set version label
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG VERSION
|
||||||
|
ARG DDCLIENT_VERSION
|
||||||
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
|
LABEL maintainer="saarg"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk add --no-cache --virtual=build-dependencies \
|
||||||
|
bzip2 \
|
||||||
|
gcc \
|
||||||
|
make \
|
||||||
|
tar \
|
||||||
|
wget && \
|
||||||
|
echo "**** install runtime packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
inotify-tools \
|
||||||
|
jq \
|
||||||
|
perl \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-io-socket-inet6 \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-json && \
|
||||||
|
echo "***** install perl modules ****" && \
|
||||||
|
curl -L http://cpanmin.us | perl - App::cpanminus && \
|
||||||
|
cpanm \
|
||||||
|
Data::Validate::IP \
|
||||||
|
JSON::Any && \
|
||||||
|
echo "**** install ddclient ****" && \
|
||||||
|
if [ -z ${DDCLIENT_VERSION+x} ]; then \
|
||||||
|
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
|
||||||
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||||
|
fi && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/ddclient && \
|
||||||
|
curl -o \
|
||||||
|
/tmp/ddclient.tar.gz -L \
|
||||||
|
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
|
||||||
|
tar xf \
|
||||||
|
/tmp/ddclient.tar.gz -C \
|
||||||
|
/tmp/ddclient --strip-components=1 && \
|
||||||
|
install -Dm755 /tmp/ddclient/ddclient /usr/bin/ && \
|
||||||
|
echo "**** cleanup ****" && \
|
||||||
|
apk del --purge \
|
||||||
|
build-dependencies && \
|
||||||
|
rm -rf \
|
||||||
|
/config/.cpanm \
|
||||||
|
/root/.cpanm \
|
||||||
|
/tmp/*
|
||||||
|
|
||||||
|
# copy local files
|
||||||
|
COPY root/ /
|
||||||
|
|
||||||
|
# ports and volumes
|
||||||
|
VOLUME /config
|
59
ddclient/Dockerfile.armhf
Normal file
59
ddclient/Dockerfile.armhf
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.12
|
||||||
|
|
||||||
|
# set version label
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG VERSION
|
||||||
|
ARG DDCLIENT_VERSION
|
||||||
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
|
LABEL maintainer="saarg"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk add --no-cache --virtual=build-dependencies \
|
||||||
|
bzip2 \
|
||||||
|
gcc \
|
||||||
|
make \
|
||||||
|
tar \
|
||||||
|
wget && \
|
||||||
|
echo "**** install runtime packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
inotify-tools \
|
||||||
|
jq \
|
||||||
|
perl \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-io-socket-inet6 \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-json && \
|
||||||
|
echo "***** install perl modules ****" && \
|
||||||
|
curl -L http://cpanmin.us | perl - App::cpanminus && \
|
||||||
|
cpanm \
|
||||||
|
Data::Validate::IP \
|
||||||
|
JSON::Any && \
|
||||||
|
echo "**** install ddclient ****" && \
|
||||||
|
if [ -z ${DDCLIENT_VERSION+x} ]; then \
|
||||||
|
DDCLIENT_VERSION=$(curl -sX GET "https://api.github.com/repos/ddclient/ddclient/releases/latest" \
|
||||||
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||||
|
fi && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/ddclient && \
|
||||||
|
curl -o \
|
||||||
|
/tmp/ddclient.tar.gz -L \
|
||||||
|
"https://github.com/ddclient/ddclient/archive/${DDCLIENT_VERSION}.tar.gz" && \
|
||||||
|
tar xf \
|
||||||
|
/tmp/ddclient.tar.gz -C \
|
||||||
|
/tmp/ddclient --strip-components=1 && \
|
||||||
|
install -Dm755 /tmp/ddclient/ddclient /usr/bin/ && \
|
||||||
|
echo "**** cleanup ****" && \
|
||||||
|
apk del --purge \
|
||||||
|
build-dependencies && \
|
||||||
|
rm -rf \
|
||||||
|
/config/.cpanm \
|
||||||
|
/root/.cpanm \
|
||||||
|
/tmp/*
|
||||||
|
|
||||||
|
# copy local files
|
||||||
|
COPY root/ /
|
||||||
|
|
||||||
|
# ports and volumes
|
||||||
|
VOLUME /config
|
740
ddclient/Jenkinsfile
vendored
Normal file
740
ddclient/Jenkinsfile
vendored
Normal file
@ -0,0 +1,740 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
label 'X86-64-MULTI'
|
||||||
|
}
|
||||||
|
options {
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '60'))
|
||||||
|
parallelsAlwaysFailFast()
|
||||||
|
}
|
||||||
|
// Input to determine if this is a package check
|
||||||
|
parameters {
|
||||||
|
string(defaultValue: 'false', description: 'package check run', name: 'PACKAGE_CHECK')
|
||||||
|
}
|
||||||
|
// Configuration for the variables used for this specific repo
|
||||||
|
environment {
|
||||||
|
BUILDS_DISCORD=credentials('build_webhook_url')
|
||||||
|
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
||||||
|
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||||
|
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||||
|
EXT_GIT_BRANCH = 'master'
|
||||||
|
EXT_USER = 'ddclient'
|
||||||
|
EXT_REPO = 'ddclient'
|
||||||
|
BUILD_VERSION_ARG = 'DDCLIENT_VERSION'
|
||||||
|
LS_USER = 'linuxserver'
|
||||||
|
LS_REPO = 'docker-ddclient'
|
||||||
|
CONTAINER_NAME = 'ddclient'
|
||||||
|
DOCKERHUB_IMAGE = 'linuxserver/ddclient'
|
||||||
|
DEV_DOCKERHUB_IMAGE = 'lsiodev/ddclient'
|
||||||
|
PR_DOCKERHUB_IMAGE = 'lspipepr/ddclient'
|
||||||
|
DIST_IMAGE = 'alpine'
|
||||||
|
MULTIARCH='true'
|
||||||
|
CI='true'
|
||||||
|
CI_WEB='false'
|
||||||
|
CI_PORT='80'
|
||||||
|
CI_SSL='false'
|
||||||
|
CI_DELAY='30'
|
||||||
|
CI_DOCKERENV='TZ=US/Pacific'
|
||||||
|
CI_AUTH='user:password'
|
||||||
|
CI_WEBPATH=''
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
// Setup all the basic environment variables needed for the build
|
||||||
|
stage("Set ENV Variables base"){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
env.EXIT_STATUS = ''
|
||||||
|
env.LS_RELEASE = sh(
|
||||||
|
script: '''docker run --rm ghcr.io/linuxserver/alexeiled-skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
env.LS_RELEASE_NOTES = sh(
|
||||||
|
script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
env.GITHUB_DATE = sh(
|
||||||
|
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
env.COMMIT_SHA = sh(
|
||||||
|
script: '''git rev-parse HEAD''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
|
||||||
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
|
||||||
|
env.PULL_REQUEST = env.CHANGE_ID
|
||||||
|
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml'
|
||||||
|
}
|
||||||
|
script{
|
||||||
|
env.LS_RELEASE_NUMBER = sh(
|
||||||
|
script: '''echo ${LS_RELEASE} |sed 's/^.*-ls//g' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
script{
|
||||||
|
env.LS_TAG_NUMBER = sh(
|
||||||
|
script: '''#! /bin/bash
|
||||||
|
tagsha=$(git rev-list -n 1 ${LS_RELEASE} 2>/dev/null)
|
||||||
|
if [ "${tagsha}" == "${COMMIT_SHA}" ]; then
|
||||||
|
echo ${LS_RELEASE_NUMBER}
|
||||||
|
elif [ -z "${GIT_COMMIT}" ]; then
|
||||||
|
echo ${LS_RELEASE_NUMBER}
|
||||||
|
else
|
||||||
|
echo $((${LS_RELEASE_NUMBER} + 1))
|
||||||
|
fi''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* #######################
|
||||||
|
Package Version Tagging
|
||||||
|
####################### */
|
||||||
|
// Grab the current package versions in Git to determine package tag
|
||||||
|
stage("Set Package tag"){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
env.PACKAGE_TAG = sh(
|
||||||
|
script: '''#!/bin/bash
|
||||||
|
if [ -e package_versions.txt ] ; then
|
||||||
|
cat package_versions.txt | md5sum | cut -c1-8
|
||||||
|
else
|
||||||
|
echo none
|
||||||
|
fi''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ########################
|
||||||
|
External Release Tagging
|
||||||
|
######################## */
|
||||||
|
// If this is a stable github release use the latest endpoint from github to determine the ext tag
|
||||||
|
stage("Set ENV github_stable"){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
env.EXT_RELEASE = sh(
|
||||||
|
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a stable or devel github release generate the link for the build message
|
||||||
|
stage("Set ENV github_link"){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Sanitize the release tag and strip illegal docker or github characters
|
||||||
|
stage("Sanitize tag"){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
env.EXT_RELEASE_CLEAN = sh(
|
||||||
|
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a master build use live docker endpoints
|
||||||
|
stage("Set ENV live build"){
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.IMAGE = env.DOCKERHUB_IMAGE
|
||||||
|
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME
|
||||||
|
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME
|
||||||
|
if (env.MULTIARCH == 'true') {
|
||||||
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
|
} else {
|
||||||
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
|
}
|
||||||
|
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
|
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a dev build use dev docker endpoints
|
||||||
|
stage("Set ENV dev build"){
|
||||||
|
when {
|
||||||
|
not {branch "master"}
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.IMAGE = env.DEV_DOCKERHUB_IMAGE
|
||||||
|
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME
|
||||||
|
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME
|
||||||
|
if (env.MULTIARCH == 'true') {
|
||||||
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||||
|
} else {
|
||||||
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||||
|
}
|
||||||
|
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||||
|
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
|
||||||
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a pull request build use dev docker endpoints
|
||||||
|
stage("Set ENV PR build"){
|
||||||
|
when {
|
||||||
|
not {environment name: 'CHANGE_ID', value: ''}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.IMAGE = env.PR_DOCKERHUB_IMAGE
|
||||||
|
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME
|
||||||
|
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME
|
||||||
|
if (env.MULTIARCH == 'true') {
|
||||||
|
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||||
|
} else {
|
||||||
|
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||||
|
}
|
||||||
|
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
|
||||||
|
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
|
||||||
|
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
|
||||||
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Run ShellCheck
|
||||||
|
stage('ShellCheck') {
|
||||||
|
when {
|
||||||
|
environment name: 'CI', value: 'true'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'),
|
||||||
|
string(credentialsId: 'ci-tests-s3-secret-access-key', variable: 'S3_SECRET')
|
||||||
|
]) {
|
||||||
|
script{
|
||||||
|
env.SHELLCHECK_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/shellcheck-result.xml'
|
||||||
|
}
|
||||||
|
sh '''curl -sL https://raw.githubusercontent.com/linuxserver/docker-shellcheck/master/checkrun.sh | /bin/bash'''
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest
|
||||||
|
docker run --rm \
|
||||||
|
-e DESTINATION=\"${IMAGE}/${META_TAG}/shellcheck-result.xml\" \
|
||||||
|
-e FILE_NAME="shellcheck-result.xml" \
|
||||||
|
-e MIMETYPE="text/xml" \
|
||||||
|
-v ${WORKSPACE}:/mnt \
|
||||||
|
-e SECRET_KEY=\"${S3_SECRET}\" \
|
||||||
|
-e ACCESS_KEY=\"${S3_KEY}\" \
|
||||||
|
-t ghcr.io/linuxserver/lsiodev-spaces-file-upload:latest \
|
||||||
|
python /upload.py'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use helper containers to render templated files
|
||||||
|
stage('Update-Templates') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
expression {
|
||||||
|
env.CONTAINER_NAME != null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
TEMPDIR=$(mktemp -d)
|
||||||
|
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
|
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
|
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||||
|
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
|
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||||
|
if [[ "${CURRENTHASH}" != "${NEWHASH}" ]]; then
|
||||||
|
mkdir -p ${TEMPDIR}/repo
|
||||||
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
|
git checkout -f master
|
||||||
|
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
|
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
||||||
|
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
|
cd ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
|
git add ${TEMPLATED_FILES}
|
||||||
|
git commit -m 'Bot Updating Templated Files'
|
||||||
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||||
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
else
|
||||||
|
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
fi
|
||||||
|
mkdir -p ${TEMPDIR}/gitbook
|
||||||
|
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
|
||||||
|
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
||||||
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
|
||||||
|
cd ${TEMPDIR}/gitbook/docker-documentation/
|
||||||
|
git add images/docker-${CONTAINER_NAME}.md
|
||||||
|
git commit -m 'Bot Updating Documentation'
|
||||||
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
|
||||||
|
fi
|
||||||
|
rm -Rf ${TEMPDIR}'''
|
||||||
|
script{
|
||||||
|
env.FILES_UPDATED = sh(
|
||||||
|
script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Exit the build if the Templated files were just updated
|
||||||
|
stage('Template-exit') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'FILES_UPDATED', value: 'true'
|
||||||
|
expression {
|
||||||
|
env.CONTAINER_NAME != null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.EXIT_STATUS = 'ABORTED'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* #######################
|
||||||
|
GitLab Mirroring
|
||||||
|
####################### */
|
||||||
|
// Ping into Gitlab to mirror this repo and have a registry endpoint
|
||||||
|
stage("GitLab Mirror"){
|
||||||
|
when {
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps{
|
||||||
|
sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \
|
||||||
|
-d '{"namespace_id":'${GITLAB_NAMESPACE}',\
|
||||||
|
"name":"'${LS_REPO}'",
|
||||||
|
"mirror":true,\
|
||||||
|
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
|
||||||
|
"issues_access_level":"disabled",\
|
||||||
|
"merge_requests_access_level":"disabled",\
|
||||||
|
"repository_access_level":"enabled",\
|
||||||
|
"visibility":"public"}' '''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ###############
|
||||||
|
Build Container
|
||||||
|
############### */
|
||||||
|
// Build Docker container for push to LS Repo
|
||||||
|
stage('Build-Single') {
|
||||||
|
when {
|
||||||
|
environment name: 'MULTIARCH', value: 'false'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
|
||||||
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Build MultiArch Docker containers for push to LS Repo
|
||||||
|
stage('Build-Multi') {
|
||||||
|
when {
|
||||||
|
environment name: 'MULTIARCH', value: 'true'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
parallel {
|
||||||
|
stage('Build X86') {
|
||||||
|
steps {
|
||||||
|
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
|
||||||
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build ARMHF') {
|
||||||
|
agent {
|
||||||
|
label 'ARMHF'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
echo 'Logging into Github'
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
'''
|
||||||
|
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
|
||||||
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||||
|
retry(5) {
|
||||||
|
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||||
|
}
|
||||||
|
sh '''docker rmi \
|
||||||
|
${IMAGE}:arm32v7-${META_TAG} \
|
||||||
|
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build ARM64') {
|
||||||
|
agent {
|
||||||
|
label 'ARM64'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
echo 'Logging into Github'
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
'''
|
||||||
|
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
|
||||||
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||||
|
retry(5) {
|
||||||
|
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
||||||
|
}
|
||||||
|
sh '''docker rmi \
|
||||||
|
${IMAGE}:arm64v8-${META_TAG} \
|
||||||
|
ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Take the image we just built and dump package versions for comparison
|
||||||
|
stage('Update-packages') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
TEMPDIR=$(mktemp -d)
|
||||||
|
if [ "${MULTIARCH}" == "true" ]; then
|
||||||
|
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
|
||||||
|
else
|
||||||
|
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
|
||||||
|
fi
|
||||||
|
if [ "${DIST_IMAGE}" == "alpine" ]; then
|
||||||
|
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
||||||
|
apk info -v > /tmp/package_versions.txt && \
|
||||||
|
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
||||||
|
chmod 777 /tmp/package_versions.txt'
|
||||||
|
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
|
||||||
|
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
|
||||||
|
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
|
||||||
|
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
|
||||||
|
chmod 777 /tmp/package_versions.txt'
|
||||||
|
fi
|
||||||
|
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
|
||||||
|
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
||||||
|
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
||||||
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
||||||
|
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
|
||||||
|
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
||||||
|
cd ${TEMPDIR}/${LS_REPO}/
|
||||||
|
wait
|
||||||
|
git add package_versions.txt
|
||||||
|
git commit -m 'Bot Updating Package Versions'
|
||||||
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||||
|
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
echo "Package tag updated, stopping build process"
|
||||||
|
else
|
||||||
|
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
echo "Package tag is same as previous continue with build process"
|
||||||
|
fi
|
||||||
|
rm -Rf ${TEMPDIR}'''
|
||||||
|
script{
|
||||||
|
env.PACKAGE_UPDATED = sh(
|
||||||
|
script: '''cat /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}''',
|
||||||
|
returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Exit the build if the package file was just updated
|
||||||
|
stage('PACKAGE-exit') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'PACKAGE_UPDATED', value: 'true'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.EXIT_STATUS = 'ABORTED'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Exit the build if this is just a package check and there are no changes to push
|
||||||
|
stage('PACKAGECHECK-exit') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'PACKAGE_UPDATED', value: 'false'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
expression {
|
||||||
|
params.PACKAGE_CHECK == 'true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script{
|
||||||
|
env.EXIT_STATUS = 'ABORTED'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* #######
|
||||||
|
Testing
|
||||||
|
####### */
|
||||||
|
// Run Container tests
|
||||||
|
stage('Test') {
|
||||||
|
when {
|
||||||
|
environment name: 'CI', value: 'true'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'ci-tests-s3-key-id', variable: 'S3_KEY'),
|
||||||
|
string(credentialsId: 'ci-tests-s3-secret-access-key ', variable: 'S3_SECRET')
|
||||||
|
]) {
|
||||||
|
script{
|
||||||
|
env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
|
||||||
|
}
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-ci:latest
|
||||||
|
if [ "${MULTIARCH}" == "true" ]; then
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||||
|
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||||
|
fi
|
||||||
|
docker run --rm \
|
||||||
|
--shm-size=1gb \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
-e IMAGE=\"${IMAGE}\" \
|
||||||
|
-e DELAY_START=\"${CI_DELAY}\" \
|
||||||
|
-e TAGS=\"${CI_TAGS}\" \
|
||||||
|
-e META_TAG=\"${META_TAG}\" \
|
||||||
|
-e PORT=\"${CI_PORT}\" \
|
||||||
|
-e SSL=\"${CI_SSL}\" \
|
||||||
|
-e BASE=\"${DIST_IMAGE}\" \
|
||||||
|
-e SECRET_KEY=\"${S3_SECRET}\" \
|
||||||
|
-e ACCESS_KEY=\"${S3_KEY}\" \
|
||||||
|
-e DOCKER_ENV=\"${CI_DOCKERENV}\" \
|
||||||
|
-e WEB_SCREENSHOT=\"${CI_WEB}\" \
|
||||||
|
-e WEB_AUTH=\"${CI_AUTH}\" \
|
||||||
|
-e WEB_PATH=\"${CI_WEBPATH}\" \
|
||||||
|
-e DO_REGION="ams3" \
|
||||||
|
-e DO_BUCKET="lsio-ci" \
|
||||||
|
-t ghcr.io/linuxserver/lsiodev-ci:latest \
|
||||||
|
python /ci/ci.py'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ##################
|
||||||
|
Release Logic
|
||||||
|
################## */
|
||||||
|
// If this is an amd64 only image only push a single image
|
||||||
|
stage('Docker-Push-Single') {
|
||||||
|
when {
|
||||||
|
environment name: 'MULTIARCH', value: 'false'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||||
|
usernameVariable: 'DOCKERUSER',
|
||||||
|
passwordVariable: 'DOCKERPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
retry(5) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
|
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
|
||||||
|
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
|
||||||
|
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest
|
||||||
|
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
||||||
|
docker push ${PUSHIMAGE}:latest
|
||||||
|
docker push ${PUSHIMAGE}:${META_TAG}
|
||||||
|
docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
|
||||||
|
docker rmi \
|
||||||
|
${DELETEIMAGE}:${META_TAG} \
|
||||||
|
${DELETEIMAGE}:${EXT_RELEASE_TAG} \
|
||||||
|
${DELETEIMAGE}:latest || :
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a multi arch release push all images and define the manifest
|
||||||
|
stage('Docker-Push-Multi') {
|
||||||
|
when {
|
||||||
|
environment name: 'MULTIARCH', value: 'true'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||||
|
usernameVariable: 'DOCKERUSER',
|
||||||
|
passwordVariable: 'DOCKERPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
retry(5) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
|
if [ "${CI}" == "false" ]; then
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
|
||||||
|
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||||
|
fi
|
||||||
|
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}"; do
|
||||||
|
docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG}
|
||||||
|
docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG}
|
||||||
|
docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||||
|
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-latest
|
||||||
|
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest
|
||||||
|
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest
|
||||||
|
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
||||||
|
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
|
||||||
|
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:amd64-latest
|
||||||
|
docker push ${MANIFESTIMAGE}:arm32v7-latest
|
||||||
|
docker push ${MANIFESTIMAGE}:arm64v8-latest
|
||||||
|
docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
|
||||||
|
docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||||
|
docker manifest push --purge ${MANIFESTIMAGE}:latest || :
|
||||||
|
docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8
|
||||||
|
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || :
|
||||||
|
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
|
||||||
|
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
|
||||||
|
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
|
||||||
|
docker manifest push --purge ${MANIFESTIMAGE}:latest
|
||||||
|
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
|
||||||
|
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG}
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
|
||||||
|
docker rmi \
|
||||||
|
${DELETEIMAGE}:amd64-${META_TAG} \
|
||||||
|
${DELETEIMAGE}:amd64-latest \
|
||||||
|
${DELETEIMAGE}:arm32v7-${META_TAG} \
|
||||||
|
${DELETEIMAGE}:arm32v7-latest \
|
||||||
|
${DELETEIMAGE}:arm64v8-${META_TAG} \
|
||||||
|
${DELETEIMAGE}:arm64v8-latest || :
|
||||||
|
done
|
||||||
|
docker rmi \
|
||||||
|
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
|
||||||
|
ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a public release tag it in the LS Github
|
||||||
|
stage('Github-Tag-Push-Release') {
|
||||||
|
when {
|
||||||
|
branch "master"
|
||||||
|
expression {
|
||||||
|
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
|
}
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
|
||||||
|
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
||||||
|
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
|
"object": "'${COMMIT_SHA}'",\
|
||||||
|
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
|
||||||
|
"type": "commit",\
|
||||||
|
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
||||||
|
echo "Pushing New release for Tag"
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
|
||||||
|
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
|
"target_commitish": "master",\
|
||||||
|
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
|
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
|
||||||
|
printf '","draft": false,"prerelease": false}' >> releasebody.json
|
||||||
|
paste -d'\\0' start releasebody.json > releasebody.json.done
|
||||||
|
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use helper container to sync the current README on master to the dockerhub endpoint
|
||||||
|
stage('Sync-README') {
|
||||||
|
when {
|
||||||
|
environment name: 'CHANGE_ID', value: ''
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
||||||
|
usernameVariable: 'DOCKERUSER',
|
||||||
|
passwordVariable: 'DOCKERPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
TEMPDIR=$(mktemp -d)
|
||||||
|
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
|
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
|
docker pull ghcr.io/linuxserver/lsiodev-readme-sync
|
||||||
|
docker run --rm=true \
|
||||||
|
-e DOCKERHUB_USERNAME=$DOCKERUSER \
|
||||||
|
-e DOCKERHUB_PASSWORD=$DOCKERPASS \
|
||||||
|
-e GIT_REPOSITORY=${LS_USER}/${LS_REPO} \
|
||||||
|
-e DOCKER_REPOSITORY=${IMAGE} \
|
||||||
|
-e GIT_BRANCH=master \
|
||||||
|
-v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \
|
||||||
|
ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
|
||||||
|
rm -Rf ${TEMPDIR} '''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If this is a Pull request send the CI link as a comment on it
|
||||||
|
stage('Pull Request Comment') {
|
||||||
|
when {
|
||||||
|
not {environment name: 'CHANGE_ID', value: ''}
|
||||||
|
environment name: 'CI', value: 'true'
|
||||||
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \
|
||||||
|
-d '{"body": "I am a bot, here are the test results for this PR: \\n'${CI_URL}' \\n'${SHELLCHECK_URL}'"}' '''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ######################
|
||||||
|
Send status to Discord
|
||||||
|
###################### */
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
script{
|
||||||
|
if (env.EXIT_STATUS == "ABORTED"){
|
||||||
|
sh 'echo "build aborted"'
|
||||||
|
}
|
||||||
|
else if (currentBuild.currentResult == "SUCCESS"){
|
||||||
|
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 1681177,\
|
||||||
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
||||||
|
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png","embeds": [{"color": 16711680,\
|
||||||
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
||||||
|
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanup {
|
||||||
|
cleanWs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
674
ddclient/LICENSE
Executable file
674
ddclient/LICENSE
Executable file
@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
13
ddclient/Makefile
Normal file
13
ddclient/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=v3.9.1-ls45
|
||||||
|
IMAGE=ddclient
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
232
ddclient/README.md
Normal file
232
ddclient/README.md
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
||||||
|
<!-- Please read the CONTRIBUTING.md -->
|
||||||
|
|
||||||
|
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
|
||||||
|
|
||||||
|
[![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!")
|
||||||
|
[![Discord](https://img.shields.io/discord/354974912613449730.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.")
|
||||||
|
[![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=discourse)](https://discourse.linuxserver.io "post on our community forum.")
|
||||||
|
[![Fleet](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.")
|
||||||
|
[![GitHub](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub&logo=github)](https://github.com/linuxserver "view the source for all of our repositories.")
|
||||||
|
[![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Supporters&logo=open%20collective)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget")
|
||||||
|
|
||||||
|
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring:
|
||||||
|
|
||||||
|
* regular and timely application updates
|
||||||
|
* easy user mappings (PGID, PUID)
|
||||||
|
* custom base image with s6 overlay
|
||||||
|
* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
|
||||||
|
* regular security updates
|
||||||
|
|
||||||
|
Find us at:
|
||||||
|
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
|
||||||
|
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
|
||||||
|
* [Discourse](https://discourse.linuxserver.io) - post on our community forum.
|
||||||
|
* [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images.
|
||||||
|
* [GitHub](https://github.com/linuxserver) - view the source for all of our repositories.
|
||||||
|
* [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget
|
||||||
|
|
||||||
|
# [linuxserver/ddclient](https://github.com/linuxserver/docker-ddclient)
|
||||||
|
|
||||||
|
[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-ddclient.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-ddclient)
|
||||||
|
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-ddclient.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-ddclient/releases)
|
||||||
|
[![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-ddclient/packages)
|
||||||
|
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-ddclient/container_registry)
|
||||||
|
[![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/ddclient.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/ddclient "Get your own version badge on microbadger.com")
|
||||||
|
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/ddclient.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/ddclient)
|
||||||
|
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/ddclient.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/ddclient)
|
||||||
|
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-ddclient%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-ddclient/job/master/)
|
||||||
|
[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fddclient%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/ddclient/latest/index.html)
|
||||||
|
|
||||||
|
[Ddclient](https://github.com/ddclient/ddclient) is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Service Provider. It was originally written by Paul Burry and is now mostly by wimpunk. It has the capability to update more than just dyndns and it can fetch your WAN-ipaddress in a few different ways.
|
||||||
|
|
||||||
|
[![ddclient](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/ddclient-logo.png)](https://github.com/ddclient/ddclient)
|
||||||
|
|
||||||
|
## Supported Architectures
|
||||||
|
|
||||||
|
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
|
||||||
|
|
||||||
|
Simply pulling `ghcr.io/linuxserver/ddclient` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
|
||||||
|
|
||||||
|
The architectures supported by this image are:
|
||||||
|
|
||||||
|
| Architecture | Tag |
|
||||||
|
| :----: | --- |
|
||||||
|
| x86-64 | amd64-latest |
|
||||||
|
| arm64 | arm64v8-latest |
|
||||||
|
| armhf | arm32v7-latest |
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Here are some example snippets to help you get started creating a container.
|
||||||
|
|
||||||
|
### docker-compose ([recommended](https://docs.linuxserver.io/general/docker-compose))
|
||||||
|
|
||||||
|
Compatible with docker-compose v2 schemas.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
version: "2.1"
|
||||||
|
services:
|
||||||
|
ddclient:
|
||||||
|
image: ghcr.io/linuxserver/ddclient
|
||||||
|
container_name: ddclient
|
||||||
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
- TZ=Europe/London
|
||||||
|
volumes:
|
||||||
|
- <path to data>:/config
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
### docker cli
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d \
|
||||||
|
--name=ddclient \
|
||||||
|
-e PUID=1000 \
|
||||||
|
-e PGID=1000 \
|
||||||
|
-e TZ=Europe/London \
|
||||||
|
-v <path to data>:/config \
|
||||||
|
--restart unless-stopped \
|
||||||
|
ghcr.io/linuxserver/ddclient
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
|
||||||
|
|
||||||
|
| Parameter | Function |
|
||||||
|
| :----: | --- |
|
||||||
|
| `-e PUID=1000` | for UserID - see below for explanation |
|
||||||
|
| `-e PGID=1000` | for GroupID - see below for explanation |
|
||||||
|
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
|
||||||
|
| `-v /config` | Where ddclient should store its config files. |
|
||||||
|
|
||||||
|
## Environment variables from files (Docker secrets)
|
||||||
|
|
||||||
|
You can set any environment variable from a file by using a special prepend `FILE__`.
|
||||||
|
|
||||||
|
As an example:
|
||||||
|
|
||||||
|
```
|
||||||
|
-e FILE__PASSWORD=/run/secrets/mysecretpassword
|
||||||
|
```
|
||||||
|
|
||||||
|
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
|
||||||
|
|
||||||
|
## Umask for running applications
|
||||||
|
|
||||||
|
For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional `-e UMASK=022` setting.
|
||||||
|
Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up [here](https://en.wikipedia.org/wiki/Umask) before asking for support.
|
||||||
|
|
||||||
|
## User / Group Identifiers
|
||||||
|
|
||||||
|
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
|
||||||
|
|
||||||
|
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
|
||||||
|
|
||||||
|
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ id username
|
||||||
|
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Application Setup
|
||||||
|
|
||||||
|
Edit the ddclient.conf file found in your /config volume. This config file has many providers to choose from and you basically just have to uncomment your provider and add username/password where requested. If you modify ddclient.conf, ddclient will automaticcaly restart and read the config.
|
||||||
|
|
||||||
|
|
||||||
|
## Docker Mods
|
||||||
|
[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=ddclient&query=%24.mods%5B%27ddclient%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=ddclient "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.")
|
||||||
|
|
||||||
|
We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.
|
||||||
|
|
||||||
|
|
||||||
|
## Support Info
|
||||||
|
|
||||||
|
* Shell access whilst the container is running: `docker exec -it ddclient /bin/bash`
|
||||||
|
* To monitor the logs of the container in realtime: `docker logs -f ddclient`
|
||||||
|
* container version number
|
||||||
|
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' ddclient`
|
||||||
|
* image version number
|
||||||
|
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' ghcr.io/linuxserver/ddclient`
|
||||||
|
|
||||||
|
## Updating Info
|
||||||
|
|
||||||
|
Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image.
|
||||||
|
|
||||||
|
Below are the instructions for updating containers:
|
||||||
|
|
||||||
|
### Via Docker Compose
|
||||||
|
* Update all images: `docker-compose pull`
|
||||||
|
* or update a single image: `docker-compose pull ddclient`
|
||||||
|
* Let compose update all containers as necessary: `docker-compose up -d`
|
||||||
|
* or update a single container: `docker-compose up -d ddclient`
|
||||||
|
* You can also remove the old dangling images: `docker image prune`
|
||||||
|
|
||||||
|
### Via Docker Run
|
||||||
|
* Update the image: `docker pull ghcr.io/linuxserver/ddclient`
|
||||||
|
* Stop the running container: `docker stop ddclient`
|
||||||
|
* Delete the container: `docker rm ddclient`
|
||||||
|
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
|
||||||
|
* You can also remove the old dangling images: `docker image prune`
|
||||||
|
|
||||||
|
### Via Watchtower auto-updater (only use if you don't remember the original parameters)
|
||||||
|
* Pull the latest image at its tag and replace it with the same env variables in one run:
|
||||||
|
```
|
||||||
|
docker run --rm \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
containrrr/watchtower \
|
||||||
|
--run-once ddclient
|
||||||
|
```
|
||||||
|
* You can also remove the old dangling images: `docker image prune`
|
||||||
|
|
||||||
|
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
|
||||||
|
|
||||||
|
### Image Update Notifications - Diun (Docker Image Update Notifier)
|
||||||
|
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
|
||||||
|
|
||||||
|
## Building locally
|
||||||
|
|
||||||
|
If you want to make local modifications to these images for development purposes or just to customize the logic:
|
||||||
|
```
|
||||||
|
git clone https://github.com/linuxserver/docker-ddclient.git
|
||||||
|
cd docker-ddclient
|
||||||
|
docker build \
|
||||||
|
--no-cache \
|
||||||
|
--pull \
|
||||||
|
-t ghcr.io/linuxserver/ddclient:latest .
|
||||||
|
```
|
||||||
|
|
||||||
|
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
||||||
|
```
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||||
|
```
|
||||||
|
|
||||||
|
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
|
||||||
|
* **01.06.20:** - Rebasing to alpine 3.12.
|
||||||
|
* **08.02.20:** - Ingest from Github.
|
||||||
|
* **06.02.19:** - Fix permissions.
|
||||||
|
* **19.12.19:** - Rebasing to alpine 3.11.
|
||||||
|
* **28.06.19:** - Rebasing to alpine 3.10.
|
||||||
|
* **23.03.19:** - Switching to new Base images, shift to arm32v7 tag.
|
||||||
|
* **10.03.19:** - Add perl-io-socket-inet6 for ipv6 support.
|
||||||
|
* **22.02.19:** - Rebasing to alpine 3.9.
|
||||||
|
* **11.02.19:** - Add pipeline logic and multi arch.
|
||||||
|
* **22.08.18:** - Rebase to alpine 3.8.
|
||||||
|
* **10.08.18:** - Update to ddclient v3.9.0. For Cloudflare users, please ensure you remove the line `server=www.cloudflare.com` from your `ddclient.conf`.
|
||||||
|
* **07.12.17:** - Rebase to alpine 3.7.
|
||||||
|
* **28.05.17:** - Rebase to alpine 3.6.
|
||||||
|
* **10.02.17:** - Rebase to alpine 3.5.
|
||||||
|
* **26.11.16:** - Update README to new standard and add icon and other small details.
|
||||||
|
* **29.08.16:** - Initial release.
|
29
ddclient/jenkins-vars.yml
Normal file
29
ddclient/jenkins-vars.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# jenkins variables
|
||||||
|
project_name: docker-ddclient
|
||||||
|
external_type: github_stable
|
||||||
|
release_type: stable
|
||||||
|
release_tag: latest
|
||||||
|
ls_branch: master
|
||||||
|
repo_vars:
|
||||||
|
- EXT_GIT_BRANCH = 'master'
|
||||||
|
- EXT_USER = 'ddclient'
|
||||||
|
- EXT_REPO = 'ddclient'
|
||||||
|
- BUILD_VERSION_ARG = 'DDCLIENT_VERSION'
|
||||||
|
- LS_USER = 'linuxserver'
|
||||||
|
- LS_REPO = 'docker-ddclient'
|
||||||
|
- CONTAINER_NAME = 'ddclient'
|
||||||
|
- DOCKERHUB_IMAGE = 'linuxserver/ddclient'
|
||||||
|
- DEV_DOCKERHUB_IMAGE = 'lsiodev/ddclient'
|
||||||
|
- PR_DOCKERHUB_IMAGE = 'lspipepr/ddclient'
|
||||||
|
- DIST_IMAGE = 'alpine'
|
||||||
|
- MULTIARCH='true'
|
||||||
|
- CI='true'
|
||||||
|
- CI_WEB='false'
|
||||||
|
- CI_PORT='80'
|
||||||
|
- CI_SSL='false'
|
||||||
|
- CI_DELAY='30'
|
||||||
|
- CI_DOCKERENV='TZ=US/Pacific'
|
||||||
|
- CI_AUTH='user:password'
|
||||||
|
- CI_WEBPATH=''
|
46
ddclient/package_versions.txt
Executable file
46
ddclient/package_versions.txt
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
alpine-baselayout-3.2.0-r7
|
||||||
|
alpine-keys-2.2-r0
|
||||||
|
apk-tools-2.10.5-r1
|
||||||
|
bash-5.0.17-r0
|
||||||
|
busybox-1.31.1-r19
|
||||||
|
ca-certificates-20191127-r4
|
||||||
|
ca-certificates-bundle-20191127-r4
|
||||||
|
coreutils-8.32-r0
|
||||||
|
curl-7.69.1-r1
|
||||||
|
inotify-tools-3.20.2.2-r0
|
||||||
|
jq-1.6-r1
|
||||||
|
libacl-2.2.53-r0
|
||||||
|
libattr-2.4.48-r0
|
||||||
|
libbz2-1.0.8-r1
|
||||||
|
libc-utils-0.7.2-r3
|
||||||
|
libcrypto1.1-1.1.1g-r0
|
||||||
|
libcurl-7.69.1-r1
|
||||||
|
libidn-1.35-r0
|
||||||
|
libintl-0.20.2-r0
|
||||||
|
libproc-3.3.16-r0
|
||||||
|
libssl1.1-1.1.1g-r0
|
||||||
|
libtls-standalone-2.9.1-r1
|
||||||
|
linux-pam-1.3.1-r4
|
||||||
|
musl-1.1.24-r9
|
||||||
|
musl-utils-1.1.24-r9
|
||||||
|
ncurses-libs-6.2_p20200523-r0
|
||||||
|
ncurses-terminfo-base-6.2_p20200523-r0
|
||||||
|
nghttp2-libs-1.41.0-r0
|
||||||
|
oniguruma-6.9.5-r2
|
||||||
|
perl-5.30.3-r0
|
||||||
|
perl-digest-sha1-2.13-r12
|
||||||
|
perl-io-socket-inet6-2.72-r1
|
||||||
|
perl-io-socket-ssl-2.068-r0
|
||||||
|
perl-json-4.02-r0
|
||||||
|
perl-net-libidn-0.12-r8
|
||||||
|
perl-net-ssleay-1.88-r0
|
||||||
|
perl-socket6-0.29-r2
|
||||||
|
procps-3.3.16-r0
|
||||||
|
readline-8.0.4-r0
|
||||||
|
scanelf-1.2.6-r0
|
||||||
|
shadow-4.8.1-r0
|
||||||
|
ssl_client-1.31.1-r19
|
||||||
|
tzdata-2020c-r0
|
||||||
|
xz-5.2.5-r0
|
||||||
|
xz-libs-5.2.5-r0
|
||||||
|
zlib-1.2.11-r3
|
64
ddclient/readme-vars.yml
Normal file
64
ddclient/readme-vars.yml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# project information
|
||||||
|
project_name: ddclient
|
||||||
|
project_url: "https://github.com/ddclient/ddclient"
|
||||||
|
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/ddclient-logo.png"
|
||||||
|
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
|
||||||
|
project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Service Provider. It was originally written by Paul Burry and is now mostly by wimpunk. It has the capability to update more than just dyndns and it can fetch your WAN-ipaddress in a few different ways."
|
||||||
|
project_blurb_optional_extras_enabled: false
|
||||||
|
|
||||||
|
# supported architectures
|
||||||
|
available_architectures:
|
||||||
|
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
|
||||||
|
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
|
||||||
|
- { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"}
|
||||||
|
|
||||||
|
# development version
|
||||||
|
development_versions: false
|
||||||
|
|
||||||
|
# container parameters
|
||||||
|
common_param_env_vars_enabled: true
|
||||||
|
param_container_name: "{{ project_name }}"
|
||||||
|
param_usage_include_net: false
|
||||||
|
param_usage_include_env: true
|
||||||
|
param_env_vars:
|
||||||
|
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
|
||||||
|
param_usage_include_vols: true
|
||||||
|
param_volumes:
|
||||||
|
- { vol_path: "/config", vol_host_path: "<path to data>", desc: "Where ddclient should store its config files." }
|
||||||
|
param_usage_include_ports: false
|
||||||
|
param_device_map: false
|
||||||
|
cap_add_param: false
|
||||||
|
|
||||||
|
# optional container parameters
|
||||||
|
opt_param_usage_include_env: false
|
||||||
|
opt_param_usage_include_vols: false
|
||||||
|
opt_param_usage_include_ports: false
|
||||||
|
opt_param_device_map: false
|
||||||
|
opt_cap_add_param: false
|
||||||
|
optional_block_1: false
|
||||||
|
|
||||||
|
# application setup block
|
||||||
|
app_setup_block_enabled: true
|
||||||
|
app_setup_block: |
|
||||||
|
Edit the ddclient.conf file found in your /config volume. This config file has many providers to choose from and you basically just have to uncomment your provider and add username/password where requested. If you modify ddclient.conf, ddclient will automaticcaly restart and read the config.
|
||||||
|
|
||||||
|
# changelog
|
||||||
|
changelogs:
|
||||||
|
- { date: "01.06.20:", desc: "Rebasing to alpine 3.12." }
|
||||||
|
- { date: "08.02.20:", desc: "Ingest from Github." }
|
||||||
|
- { date: "06.02.19:", desc: "Fix permissions." }
|
||||||
|
- { date: "19.12.19:", desc: "Rebasing to alpine 3.11." }
|
||||||
|
- { date: "28.06.19:", desc: "Rebasing to alpine 3.10." }
|
||||||
|
- { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." }
|
||||||
|
- { date: "10.03.19:", desc: "Add perl-io-socket-inet6 for ipv6 support." }
|
||||||
|
- { date: "22.02.19:", desc: "Rebasing to alpine 3.9." }
|
||||||
|
- { date: "11.02.19:", desc: "Add pipeline logic and multi arch." }
|
||||||
|
- { date: "22.08.18:", desc: "Rebase to alpine 3.8." }
|
||||||
|
- { date: "10.08.18:", desc: "Update to ddclient v3.9.0. For Cloudflare users, please ensure you remove the line `server=www.cloudflare.com` from your `ddclient.conf`." }
|
||||||
|
- { date: "07.12.17:", desc: "Rebase to alpine 3.7." }
|
||||||
|
- { date: "28.05.17:", desc: "Rebase to alpine 3.6." }
|
||||||
|
- { date: "10.02.17:", desc: "Rebase to alpine 3.5." }
|
||||||
|
- { date: "26.11.16:", desc: "Update README to new standard and add icon and other small details." }
|
||||||
|
- { date: "29.08.16:", desc: "Initial release." }
|
242
ddclient/root/defaults/ddclient.conf
Normal file
242
ddclient/root/defaults/ddclient.conf
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
######################################################################
|
||||||
|
##
|
||||||
|
## Define default global variables with lines like:
|
||||||
|
## var=value [, var=value]*
|
||||||
|
## These values will be used for each following host unless overridden
|
||||||
|
## with a local variable definition.
|
||||||
|
##
|
||||||
|
## Define local variables for one or more hosts with:
|
||||||
|
## var=value [, var=value]* host.and.domain[,host2.and.domain...]
|
||||||
|
##
|
||||||
|
## Lines can be continued on the following line by ending the line
|
||||||
|
## with a \
|
||||||
|
##
|
||||||
|
##
|
||||||
|
## Warning: not all supported routers or dynamic DNS services
|
||||||
|
## are mentioned here.
|
||||||
|
##
|
||||||
|
######################################################################
|
||||||
|
daemon=300 # check every 300 seconds
|
||||||
|
syslog=yes # log update msgs to syslog
|
||||||
|
#mail=root # mail all msgs to root
|
||||||
|
#mail-failure=root # mail failed update msgs to root
|
||||||
|
pid=/var/run/ddclient/ddclient.pid # record PID in file.
|
||||||
|
ssl=yes # use ssl-support. Works with
|
||||||
|
# ssl-library
|
||||||
|
# postscript=script # run script after updating. The
|
||||||
|
# new IP is added as argument.
|
||||||
|
#
|
||||||
|
#use=watchguard-soho, fw=192.168.111.1:80 # via Watchguard's SOHO FW
|
||||||
|
#use=netopia-r910, fw=192.168.111.1:80 # via Netopia R910 FW
|
||||||
|
#use=smc-barricade, fw=192.168.123.254:80 # via SMC's Barricade FW
|
||||||
|
#use=netgear-rt3xx, fw=192.168.0.1:80 # via Netgear's internet FW
|
||||||
|
#use=linksys, fw=192.168.1.1:80 # via Linksys's internet FW
|
||||||
|
#use=maxgate-ugate3x00, fw=192.168.0.1:80 # via MaxGate's UGATE-3x00 FW
|
||||||
|
#use=elsa-lancom-dsl10, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
|
||||||
|
#use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
|
||||||
|
#use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
|
||||||
|
#use=alcatel-stp, fw=10.0.0.138:80 # via Alcatel Speed Touch Pro
|
||||||
|
#use=xsense-aero, fw=192.168.1.1:80 # via Xsense Aero Router
|
||||||
|
#use=allnet-1298, fw=192.168.1.1:80 # via AllNet 1298 DSL Router
|
||||||
|
#use=3com-oc-remote812, fw=192.168.0.254:80 # via 3com OfficeConnect Remote 812
|
||||||
|
#use=e-tech, fw=192.168.1.1:80 # via E-tech Router
|
||||||
|
#use=cayman-3220h, fw=192.168.0.1:1080 # via Cayman 3220-H DSL Router
|
||||||
|
#
|
||||||
|
#fw-login=admin, fw-password=XXXXXX # FW login and password
|
||||||
|
#
|
||||||
|
## To obtain an IP address from FW status page (using fw-login, fw-password)
|
||||||
|
#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP Address
|
||||||
|
#
|
||||||
|
## To obtain an IP address from Web status page (using the proxy if defined)
|
||||||
|
## by default, checkip.dyndns.org is used if you use the dyndns protocol.
|
||||||
|
## Using use=web is enough to get it working.
|
||||||
|
## WARNING: set deamon at least to 600 seconds if you use checkip or you could
|
||||||
|
## get banned from their service.
|
||||||
|
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
|
||||||
|
#
|
||||||
|
#use=ip, ip=127.0.0.1 # via static IP's
|
||||||
|
#use=if, if=eth0 # via interfaces
|
||||||
|
#use=web # via web
|
||||||
|
#
|
||||||
|
#protocol=dyndns2 # default protocol
|
||||||
|
#proxy=fasthttp.sympatico.ca:80 # default proxy
|
||||||
|
#server=members.dyndns.org # default server
|
||||||
|
#server=members.dyndns.org:8245 # default server (bypassing proxies)
|
||||||
|
|
||||||
|
#login=your-login # default login
|
||||||
|
#password=test # default password
|
||||||
|
#mx=mx.for.your.host # default MX
|
||||||
|
#backupmx=yes|no # host is primary MX?
|
||||||
|
#wildcard=yes|no # add wildcard CNAME?
|
||||||
|
|
||||||
|
##
|
||||||
|
## dyndns.org dynamic addresses
|
||||||
|
##
|
||||||
|
## (supports variables: wildcard,mx,backupmx)
|
||||||
|
##
|
||||||
|
# server=members.dyndns.org, \
|
||||||
|
# protocol=dyndns2 \
|
||||||
|
# your-dynamic-host.dyndns.org
|
||||||
|
|
||||||
|
##
|
||||||
|
## dyndns.org static addresses
|
||||||
|
##
|
||||||
|
## (supports variables: wildcard,mx,backupmx)
|
||||||
|
##
|
||||||
|
# static=yes, \
|
||||||
|
# server=members.dyndns.org, \
|
||||||
|
# protocol=dyndns2 \
|
||||||
|
# your-static-host.dyndns.org
|
||||||
|
|
||||||
|
##
|
||||||
|
##
|
||||||
|
## dyndns.org custom addresses
|
||||||
|
##
|
||||||
|
## (supports variables: wildcard,mx,backupmx)
|
||||||
|
##
|
||||||
|
# custom=yes, \
|
||||||
|
# server=members.dyndns.org, \
|
||||||
|
# protocol=dyndns2 \
|
||||||
|
# your-domain.top-level,your-other-domain.top-level
|
||||||
|
|
||||||
|
##
|
||||||
|
## ZoneEdit (zoneedit.com)
|
||||||
|
##
|
||||||
|
# server=dynamic.zoneedit.com, \
|
||||||
|
# protocol=zoneedit1, \
|
||||||
|
# login=your-zoneedit-login, \
|
||||||
|
# password=your-zoneedit-password \
|
||||||
|
# your.any.domain,your-2nd.any.dom
|
||||||
|
|
||||||
|
##
|
||||||
|
## EasyDNS (easydns.com)
|
||||||
|
##
|
||||||
|
# server=members.easydns.com, \
|
||||||
|
# protocol=easydns, \
|
||||||
|
# login=your-easydns-login, \
|
||||||
|
# password=your-easydns-password \
|
||||||
|
# your.any.domain,your-2nd.any.domain
|
||||||
|
|
||||||
|
##
|
||||||
|
## Hammernode (hn.org) dynamic addresses
|
||||||
|
##
|
||||||
|
# server=dup.hn.org, \
|
||||||
|
# protocol=hammernode1, \
|
||||||
|
# login=your-hn-login, \
|
||||||
|
# password=your-hn-password \
|
||||||
|
# your-hn-host.hn.org,your-2nd-hn-host.hn.org
|
||||||
|
|
||||||
|
##
|
||||||
|
## dslreports.com dynamic-host monitoring
|
||||||
|
##
|
||||||
|
# server=members.dslreports.com \
|
||||||
|
# protocol=dslreports1, \
|
||||||
|
# login=dslreports-login, \
|
||||||
|
# password=dslreports-password \
|
||||||
|
# dslreports-unique-id
|
||||||
|
|
||||||
|
##
|
||||||
|
## OrgDNS.org account-configuration
|
||||||
|
##
|
||||||
|
# use=web, web=members.orgdns.org/nic/ip
|
||||||
|
# server=www.orgdns.org \
|
||||||
|
# protocol=dyndns2 \
|
||||||
|
# login=yourLoginName \
|
||||||
|
# password=yourPassword \
|
||||||
|
# yourSubdomain.orgdns.org
|
||||||
|
|
||||||
|
##
|
||||||
|
## dnspark.com
|
||||||
|
## (supports variables: mx, mxpri)
|
||||||
|
##
|
||||||
|
# use=web, web=ipdetect.dnspark.com, web-skip='Current Address:'
|
||||||
|
# protocol=dnspark, \
|
||||||
|
# server=www.dnspark.com, \
|
||||||
|
# your-host.dnspark.com
|
||||||
|
|
||||||
|
##
|
||||||
|
## NameCheap (namecheap.com)
|
||||||
|
##
|
||||||
|
# protocol=namecheap, \
|
||||||
|
# server=dynamicdns.park-your-domain.com, \
|
||||||
|
# login=my-namecheap.com-login, \
|
||||||
|
# password=my-namecheap.com-password \
|
||||||
|
# myhost.namecheap.com
|
||||||
|
|
||||||
|
##
|
||||||
|
##
|
||||||
|
## Loopia (loopia.se)
|
||||||
|
##
|
||||||
|
# use=web
|
||||||
|
# web=loopia
|
||||||
|
# protocol=dyndns2
|
||||||
|
# server=dns.loopia.se
|
||||||
|
# script=/XDynDNSServer/XDynDNS.php
|
||||||
|
# login=my-loopia.se-login
|
||||||
|
# password=my-loopia.se-password
|
||||||
|
# my.domain.tld,other.domain.tld
|
||||||
|
|
||||||
|
##
|
||||||
|
##
|
||||||
|
## ChangeIP (changeip.com)
|
||||||
|
##
|
||||||
|
## single host update
|
||||||
|
# protocol=changeip, \
|
||||||
|
# login=my-my-changeip.com-login, \
|
||||||
|
# password=my-changeip.com-password \
|
||||||
|
# myhost.changeip.org
|
||||||
|
|
||||||
|
##
|
||||||
|
## DtDNS (www.dtdns.com)
|
||||||
|
##
|
||||||
|
# protocol=dtdns,
|
||||||
|
# server=www.dtdns.com,
|
||||||
|
# client=ddclient,
|
||||||
|
# password=my-dtdns.com-password
|
||||||
|
# myhost.dtdns.net, otherhost.dtdns.net
|
||||||
|
|
||||||
|
##
|
||||||
|
## CloudFlare (www.cloudflare.com)
|
||||||
|
##
|
||||||
|
#protocol=cloudflare, \
|
||||||
|
#zone=domain.tld, \
|
||||||
|
#ttl=1, \
|
||||||
|
#login=your-login-email, \
|
||||||
|
#password=APIKey \
|
||||||
|
#domain.tld,my.domain.tld
|
||||||
|
|
||||||
|
##
|
||||||
|
## Google Domains (www.google.com/domains)
|
||||||
|
##
|
||||||
|
# protocol=googledomains,
|
||||||
|
# login=my-auto-generated-username,
|
||||||
|
# password=my-auto-generated-password
|
||||||
|
# my.domain.tld, otherhost.domain.tld
|
||||||
|
|
||||||
|
##
|
||||||
|
## Duckdns (http://www.duckdns.org/)
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# password=my-auto-generated-password
|
||||||
|
# protocol=duckdns hostwithoutduckdnsorg
|
||||||
|
|
||||||
|
##
|
||||||
|
## Freemyip (http://freemyip.com/)
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# protocol=freemyip,
|
||||||
|
# password=my-token
|
||||||
|
# myhost
|
||||||
|
|
||||||
|
##
|
||||||
|
## MyOnlinePortal (http://myonlineportal.net)
|
||||||
|
##
|
||||||
|
# protocol=dyndns2
|
||||||
|
# ssl=yes
|
||||||
|
# # ipv6=yes # optional
|
||||||
|
# use=web, web=myonlineportal.net/checkip
|
||||||
|
# # use=if, if=eth0 # alternative to use=web
|
||||||
|
# # if-skip=Scope:Link # alternative to use=web
|
||||||
|
# login=your-myonlineportal-username
|
||||||
|
# password=your-myonlineportal-password
|
||||||
|
# domain.myonlineportal.net
|
25
ddclient/root/etc/cont-init.d/30-config
Normal file
25
ddclient/root/etc/cont-init.d/30-config
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
# make our folders
|
||||||
|
mkdir -p \
|
||||||
|
/var/cache/ddclient \
|
||||||
|
/var/run/ddclient
|
||||||
|
|
||||||
|
# copy default config if not present in /config
|
||||||
|
[[ ! -e /config/ddclient.conf ]] && \
|
||||||
|
cp /defaults/ddclient.conf /config
|
||||||
|
|
||||||
|
# copy config from /config to root
|
||||||
|
cp /config/ddclient.conf /ddclient.conf
|
||||||
|
|
||||||
|
# permissions
|
||||||
|
chown -R abc:abc \
|
||||||
|
/config \
|
||||||
|
/var/cache/ddclient \
|
||||||
|
/var/run/ddclient \
|
||||||
|
/ddclient.conf
|
||||||
|
|
||||||
|
chmod 700 /config
|
||||||
|
chmod 600 \
|
||||||
|
/config/* \
|
||||||
|
/ddclient.conf
|
3
ddclient/root/etc/services.d/ddclient/run
Normal file
3
ddclient/root/etc/services.d/ddclient/run
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
exec \
|
||||||
|
s6-setuidgid abc /usr/bin/ddclient -foreground -file /ddclient.conf
|
10
ddclient/root/etc/services.d/inotify_modify/run
Normal file
10
ddclient/root/etc/services.d/inotify_modify/run
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
# starting inotify to watch /config/ddclient.conf and restart ddclient if changed.
|
||||||
|
while inotifywait -e modify /config/ddclient.conf; do
|
||||||
|
cp /config/ddclient.conf /ddclient.conf
|
||||||
|
chown abc:abc /ddclient.conf
|
||||||
|
chmod 600 /ddclient.conf
|
||||||
|
s6-svc -h /var/run/s6/services/ddclient
|
||||||
|
echo "ddclient has been restarted"
|
||||||
|
done
|
18
dovecot/Dockerfile
Normal file
18
dovecot/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM centos:8
|
||||||
|
|
||||||
|
RUN useradd -m -s /bin/false vmail
|
||||||
|
|
||||||
|
RUN dnf install -y epel-release && dnf update -y \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm \
|
||||||
|
&& dnf install -y --enablerepo=gf-plus postfix3-3.5.8 postfix3-ldap-3.5.8 postfix3-mysql-3.5.8 postfix3-pgsql-3.5.8 \
|
||||||
|
&& dnf install -y dovecot-2.3.8 dovecot-pigeonhole-2.3.8 opendkim-2.11.0 opendmarc-1.3.2 \
|
||||||
|
&& dnf install -y cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
EXPOSE 110 143 993 995
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/dovecot", "-F"]
|
13
dovecot/Makefile
Normal file
13
dovecot/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=2.3.8
|
||||||
|
IMAGE=dovecot
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
78
haproxy/Dockerfile
Normal file
78
haproxy/Dockerfile
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# vim:set ft=dockerfile:
|
||||||
|
FROM debian:buster-slim
|
||||||
|
|
||||||
|
ENV HAPROXY_VERSION 2.3.1
|
||||||
|
ENV HAPROXY_URL https://www.haproxy.org/download/2.3/src/haproxy-2.3.1.tar.gz
|
||||||
|
ENV HAPROXY_SHA256 8d3bf1252a5b60b21e9885c8d0d6d89e932d320c2977a6522aed6df81eefca4b
|
||||||
|
|
||||||
|
# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
|
||||||
|
RUN set -eux; \
|
||||||
|
\
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
gcc \
|
||||||
|
libc6-dev \
|
||||||
|
liblua5.3-dev \
|
||||||
|
libpcre2-dev \
|
||||||
|
libssl-dev \
|
||||||
|
make \
|
||||||
|
wget \
|
||||||
|
zlib1g-dev \
|
||||||
|
; \
|
||||||
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
\
|
||||||
|
wget -O haproxy.tar.gz "$HAPROXY_URL"; \
|
||||||
|
echo "$HAPROXY_SHA256 *haproxy.tar.gz" | sha256sum -c; \
|
||||||
|
mkdir -p /usr/src/haproxy; \
|
||||||
|
tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1; \
|
||||||
|
rm haproxy.tar.gz; \
|
||||||
|
\
|
||||||
|
makeOpts=' \
|
||||||
|
TARGET=linux-glibc \
|
||||||
|
USE_GETADDRINFO=1 \
|
||||||
|
USE_LUA=1 LUA_INC=/usr/include/lua5.3 \
|
||||||
|
USE_OPENSSL=1 \
|
||||||
|
USE_PCRE2=1 USE_PCRE2_JIT=1 \
|
||||||
|
USE_ZLIB=1 \
|
||||||
|
\
|
||||||
|
EXTRA_OBJS=" \
|
||||||
|
# see https://github.com/docker-library/haproxy/issues/94#issuecomment-505673353 for more details about prometheus support
|
||||||
|
contrib/prometheus-exporter/service-prometheus.o \
|
||||||
|
" \
|
||||||
|
'; \
|
||||||
|
# https://salsa.debian.org/haproxy-team/haproxy/-/commit/53988af3d006ebcbf2c941e34121859fd6379c70
|
||||||
|
dpkgArch="$(dpkg --print-architecture)"; \
|
||||||
|
case "$dpkgArch" in \
|
||||||
|
armel) makeOpts="$makeOpts ADDLIB=-latomic" ;; \
|
||||||
|
esac; \
|
||||||
|
\
|
||||||
|
nproc="$(nproc)"; \
|
||||||
|
eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts"; \
|
||||||
|
eval "make -C /usr/src/haproxy install-bin $makeOpts"; \
|
||||||
|
\
|
||||||
|
mkdir -p /usr/local/etc/haproxy; \
|
||||||
|
cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors; \
|
||||||
|
rm -rf /usr/src/haproxy; \
|
||||||
|
\
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
|
||||||
|
find /usr/local -type f -executable -exec ldd '{}' ';' \
|
||||||
|
| awk '/=>/ { print $(NF-1) }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query --search \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r apt-mark manual \
|
||||||
|
; \
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
|
||||||
|
|
||||||
|
# https://www.haproxy.org/download/1.8/doc/management.txt
|
||||||
|
# "4. Stopping and restarting HAProxy"
|
||||||
|
# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed"
|
||||||
|
# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process"
|
||||||
|
STOPSIGNAL SIGUSR1
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/conf.d"]
|
13
haproxy/Makefile
Normal file
13
haproxy/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=2.3.1
|
||||||
|
IMAGE=haproxy
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
68
haproxy/alpine/Dockerfile
Normal file
68
haproxy/alpine/Dockerfile
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# vim:set ft=dockerfile:
|
||||||
|
FROM alpine:3.12
|
||||||
|
|
||||||
|
ENV HAPROXY_VERSION 2.3.1
|
||||||
|
ENV HAPROXY_URL https://www.haproxy.org/download/2.3/src/haproxy-2.3.1.tar.gz
|
||||||
|
ENV HAPROXY_SHA256 8d3bf1252a5b60b21e9885c8d0d6d89e932d320c2977a6522aed6df81eefca4b
|
||||||
|
|
||||||
|
# see https://sources.debian.net/src/haproxy/jessie/debian/rules/ for some helpful navigation of the possible "make" arguments
|
||||||
|
RUN set -x \
|
||||||
|
\
|
||||||
|
&& apk add --no-cache --virtual .build-deps \
|
||||||
|
gcc \
|
||||||
|
libc-dev \
|
||||||
|
linux-headers \
|
||||||
|
lua5.3-dev \
|
||||||
|
make \
|
||||||
|
openssl \
|
||||||
|
openssl-dev \
|
||||||
|
pcre2-dev \
|
||||||
|
readline-dev \
|
||||||
|
tar \
|
||||||
|
zlib-dev \
|
||||||
|
\
|
||||||
|
&& wget -O haproxy.tar.gz "$HAPROXY_URL" \
|
||||||
|
&& echo "$HAPROXY_SHA256 *haproxy.tar.gz" | sha256sum -c \
|
||||||
|
&& mkdir -p /usr/src/haproxy \
|
||||||
|
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
|
||||||
|
&& rm haproxy.tar.gz \
|
||||||
|
\
|
||||||
|
&& makeOpts=' \
|
||||||
|
TARGET=linux-musl \
|
||||||
|
USE_GETADDRINFO=1 \
|
||||||
|
USE_LUA=1 LUA_INC=/usr/include/lua5.3 LUA_LIB=/usr/lib/lua5.3 \
|
||||||
|
USE_OPENSSL=1 \
|
||||||
|
USE_PCRE2=1 USE_PCRE2_JIT=1 \
|
||||||
|
USE_ZLIB=1 \
|
||||||
|
\
|
||||||
|
EXTRA_OBJS=" \
|
||||||
|
# see https://github.com/docker-library/haproxy/issues/94#issuecomment-505673353 for more details about prometheus support
|
||||||
|
contrib/prometheus-exporter/service-prometheus.o \
|
||||||
|
" \
|
||||||
|
' \
|
||||||
|
&& nproc="$(getconf _NPROCESSORS_ONLN)" \
|
||||||
|
&& eval "make -C /usr/src/haproxy -j '$nproc' all $makeOpts" \
|
||||||
|
&& eval "make -C /usr/src/haproxy install-bin $makeOpts" \
|
||||||
|
\
|
||||||
|
&& mkdir -p /usr/local/etc/haproxy \
|
||||||
|
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
|
||||||
|
&& rm -rf /usr/src/haproxy \
|
||||||
|
\
|
||||||
|
&& runDeps="$( \
|
||||||
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
||||||
|
| tr ',' '\n' \
|
||||||
|
| sort -u \
|
||||||
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
|
)" \
|
||||||
|
&& apk add --no-network --virtual .haproxy-rundeps $runDeps \
|
||||||
|
&& apk del --no-network .build-deps
|
||||||
|
|
||||||
|
# https://www.haproxy.org/download/1.8/doc/management.txt
|
||||||
|
# "4. Stopping and restarting HAProxy"
|
||||||
|
# "when the SIGTERM signal is sent to the haproxy process, it immediately quits and all established connections are closed"
|
||||||
|
# "graceful stop is triggered when the SIGUSR1 signal is sent to the haproxy process"
|
||||||
|
STOPSIGNAL SIGUSR1
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/conf.d"]
|
17
haproxy/alpine/docker-entrypoint.sh
Executable file
17
haproxy/alpine/docker-entrypoint.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# first arg is `-f` or `--some-option`
|
||||||
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
set -- haproxy "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = 'haproxy' ]; then
|
||||||
|
shift # "haproxy"
|
||||||
|
# if the user wants "haproxy", let's add a couple useful flags
|
||||||
|
# -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2")
|
||||||
|
# -db -- disables background mode
|
||||||
|
set -- haproxy -W -db "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
17
haproxy/docker-entrypoint.sh
Executable file
17
haproxy/docker-entrypoint.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# first arg is `-f` or `--some-option`
|
||||||
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
set -- haproxy "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = 'haproxy' ]; then
|
||||||
|
shift # "haproxy"
|
||||||
|
# if the user wants "haproxy", let's add a couple useful flags
|
||||||
|
# -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2")
|
||||||
|
# -db -- disables background mode
|
||||||
|
set -- haproxy -W -db "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
18
opendkim/Dockerfile
Normal file
18
opendkim/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM centos:8
|
||||||
|
|
||||||
|
RUN useradd -m -s /bin/false vmail
|
||||||
|
|
||||||
|
RUN dnf install -y epel-release && dnf update -y \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm \
|
||||||
|
&& dnf install -y --enablerepo=gf-plus postfix3-3.5.8 postfix3-ldap-3.5.8 postfix3-mysql-3.5.8 postfix3-pgsql-3.5.8 \
|
||||||
|
&& dnf install -y dovecot-2.3.8 dovecot-pigeonhole-2.3.8 opendkim-2.11.0 opendmarc-1.3.2 \
|
||||||
|
&& dnf install -y cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
EXPOSE 8891
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/opendkim", "-f", "-x", "/etc/opendkim/opendkim.conf"]
|
13
opendkim/Makefile
Normal file
13
opendkim/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=2.11.0
|
||||||
|
IMAGE=opendkim
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
18
opendmarc/Dockerfile
Normal file
18
opendmarc/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM centos:8
|
||||||
|
|
||||||
|
RUN useradd -m -s /bin/false vmail
|
||||||
|
|
||||||
|
RUN dnf install -y epel-release && dnf update -y \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm \
|
||||||
|
&& dnf install -y --enablerepo=gf-plus postfix3-3.5.8 postfix3-ldap-3.5.8 postfix3-mysql-3.5.8 postfix3-pgsql-3.5.8 \
|
||||||
|
&& dnf install -y dovecot-2.3.8 dovecot-pigeonhole-2.3.8 opendkim-2.11.0 opendmarc-1.3.2 \
|
||||||
|
&& dnf install -y cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
EXPOSE 8893
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/opendmarc", "-f", "-c", "/etc/opendmarc/opendmarc.conf"]
|
13
opendmarc/Makefile
Normal file
13
opendmarc/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=1.3.2
|
||||||
|
IMAGE=opendmarc
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
15
playmaker/.gitignore
vendored
Normal file
15
playmaker/.gitignore
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
*.pyc
|
||||||
|
**/__pycache__/
|
||||||
|
*.swp
|
||||||
|
*.apk
|
||||||
|
.tern-project
|
||||||
|
.ycm_extra_conf.py
|
||||||
|
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
node_modules/
|
||||||
|
.ropeproject/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
*.egg-info/
|
||||||
|
*.egg
|
67
playmaker/Dockerfile
Normal file
67
playmaker/Dockerfile
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
FROM python:3-buster
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y git \
|
||||||
|
lib32stdc++6 \
|
||||||
|
lib32gcc1 \
|
||||||
|
lib32z1 \
|
||||||
|
lib32ncurses6 \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt1-dev \
|
||||||
|
openjdk-11-jdk-headless \
|
||||||
|
virtualenv \
|
||||||
|
wget \
|
||||||
|
unzip \
|
||||||
|
zlib1g-dev \
|
||||||
|
less \
|
||||||
|
mc \
|
||||||
|
nano
|
||||||
|
|
||||||
|
RUN mkdir -p /data/fdroid/repo && \
|
||||||
|
mkdir -p /opt/playmaker
|
||||||
|
|
||||||
|
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip \
|
||||||
|
&& echo "F10F9D5BCA53CC27E2D210BE2CBC7C0F1EE906AD9B868748D74D62E10F2C8275 commandlinetools-linux-6200805_latest.zip" | sha256sum -c \
|
||||||
|
&& unzip commandlinetools-linux-6200805_latest.zip \
|
||||||
|
&& rm commandlinetools-linux-6200805_latest.zip
|
||||||
|
|
||||||
|
RUN mkdir /opt/android-sdk-linux \
|
||||||
|
&& mv tools /opt/android-sdk-linux/tools
|
||||||
|
|
||||||
|
ENV ANDROID_HOME=/opt/android-sdk-linux
|
||||||
|
ENV PATH=$PATH:$ANDROID_HOME/tools
|
||||||
|
|
||||||
|
RUN echo 'y' | /opt/android-sdk-linux/tools/bin/sdkmanager --sdk_root=/opt/android-sdk-linux --verbose --install "platforms;android-28" "build-tools;28.0.3"
|
||||||
|
|
||||||
|
RUN echo 'y' | rm -rf tools
|
||||||
|
|
||||||
|
COPY README.md setup.py pm-server /opt/playmaker/
|
||||||
|
COPY playmaker /opt/playmaker/playmaker
|
||||||
|
|
||||||
|
WORKDIR /opt/playmaker
|
||||||
|
|
||||||
|
RUN pip3 install fdroidserver
|
||||||
|
|
||||||
|
RUN pip3 install .
|
||||||
|
|
||||||
|
RUN rm -rf /opt/playmaker
|
||||||
|
|
||||||
|
RUN groupadd -g 999 pmuser && \
|
||||||
|
useradd -m -u 999 -g pmuser pmuser
|
||||||
|
|
||||||
|
RUN chown -R pmuser:pmuser /data/fdroid && \
|
||||||
|
chown -R pmuser:pmuser /opt/playmaker
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/local/share/doc/fdroidserver/examples && \
|
||||||
|
cp -r /usr/local/lib/python3.9/site-packages/usr/local/share/doc/fdroidserver/examples/* /usr/local/share/doc/fdroidserver/examples
|
||||||
|
|
||||||
|
USER pmuser
|
||||||
|
|
||||||
|
VOLUME /data/fdroid
|
||||||
|
WORKDIR /data/fdroid
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
ENTRYPOINT python3 -u /usr/local/bin/pm-server --fdroid --debug
|
13
playmaker/Makefile
Normal file
13
playmaker/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=0.6.4
|
||||||
|
IMAGE=playmaker
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
93
playmaker/README.md
Normal file
93
playmaker/README.md
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# Playmaker
|
||||||
|
|
||||||
|
![screenshot](https://github.com/NoMore201/playmaker/raw/master/example.png)
|
||||||
|
|
||||||
|
## Description & Features
|
||||||
|
|
||||||
|
Playmaker is a fdroid repository manager, which lets you download/update apps from the play store using your google account
|
||||||
|
and configure repository with app you download. After you setup the server, repository will be available at the address
|
||||||
|
`http[s]://<playmaker_host>/fdroid`, and you can start downloading apps from play store.
|
||||||
|
|
||||||
|
Server uses [googleplay-api](https://github.com/NoMore201/googleplay-api) library, which is the python equivalent of the Java [play-store-api](https://github.com/yeriomin/play-store-api) library used by YalpStore.
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Download apks from google play store to your collection
|
||||||
|
* Generate a fdroid repository serving apks downloaded, directly from `<pm_url>/fdroid`
|
||||||
|
* Configure automatic updates of app+repo through a Crontab string
|
||||||
|
* Non-blocking UI, you can browse the collection or search for an app while the server is updating the fdroid
|
||||||
|
repository.
|
||||||
|
* Responsive UI, usable also from a mobile device
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
To avoid authentication problems, like captcha requests, it's recommended to setup app specific password, and securing your account with 2-factor auth. There are two ways to login to Play Store:
|
||||||
|
|
||||||
|
- Providing credentials in a configuration file
|
||||||
|
- Through a login page.
|
||||||
|
|
||||||
|
The default behaviour is to ask credentials with a login page, when accessing playmaker on first launch. In order to skip login page, it is possible to provide google credentials through a configuration file. Just put `credentials.conf` inside the playmaker directory, with this structure:
|
||||||
|
|
||||||
|
```
|
||||||
|
[google]
|
||||||
|
email = myemail@gmail.com
|
||||||
|
password = mypassword
|
||||||
|
```
|
||||||
|
|
||||||
|
To restrict access to that file, ensure it is readable only by user running playmaker.
|
||||||
|
|
||||||
|
### HTTPS
|
||||||
|
|
||||||
|
It's recommended to configure playmaker with HTTPS, especially with the login page authentication, since playmaker needs to send to the server credentials in plaintext. You can setup it in conjunction with a proxy like nginx, or provide certificate directly to playmaker.
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
Since this app requires a lot of heavy dependencies, like Android SDK and fdroidserver, it is recommended to use the docker image.
|
||||||
|
You can use a pre-built image on [docker hub](https://hub.docker.com/r/nomore201/playmaker/builds/) or build by yourself using provided `Dockerfile`.
|
||||||
|
There are some environment variables you'll want to use:
|
||||||
|
|
||||||
|
- `HTTPS_CERTFILE`: path of the https certificate file
|
||||||
|
- `HTTPS_KEYFILE`: path of the https key file
|
||||||
|
- `LANG_LOCALE`: set a specific locale. Defaults to the system one if not set
|
||||||
|
- `LANG_TIMEZONE`: set a specific timezone. Defaults to `Europe/Berlin` if not set
|
||||||
|
- `CRONTAB_STRING`: crontab string to configure automatic updates. Defaults to every night at 2AM (`0 2 * * *`)
|
||||||
|
- `DEVICE_CODE`: specify a device to be used by playmaker, defaults to `bacon` (OnePlus One) if not specified. For
|
||||||
|
a list of supported devices see [this file](https://raw.githubusercontent.com/NoMore201/googleplay-api/master/gpapi/device.properties)
|
||||||
|
|
||||||
|
To enable HTTPS through playmaker, without an external tool, just define `HTTPS_CERTFILE`
|
||||||
|
and `HTTPS_KEYFILE` with paths to those file. If these variables are not set, tornado will default to http.
|
||||||
|
|
||||||
|
If you want to browse apps for a specific country, you need to specify the variables `LANG_LOCALE` and `LANG_TIMEZONE`.
|
||||||
|
Before creating an issue "cannot find app X", make sure the app is available it that country.
|
||||||
|
|
||||||
|
The docker run command will look like this:
|
||||||
|
```
|
||||||
|
docker run -d --name playmaker \
|
||||||
|
-p 5000:5000 \
|
||||||
|
-v /srv/fdroid:/data/fdroid \
|
||||||
|
-e HTTPS_CERTFILE="/srv/https.crt" \
|
||||||
|
-e HTTPS_KEYFILE="/srv/https.key" \
|
||||||
|
-e LANG_LOCALE="de_DE" \
|
||||||
|
-e LANG_TIMEZONE="Europe/Berlin" \
|
||||||
|
-e DEVICE_CODE="hammerhead" \
|
||||||
|
fellek/playmaker:fellek
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to run it in a virtualenv rather than using docker, remember that you need to install fdroidserver,
|
||||||
|
android SDK and define the ANDROID\_HOME env variable (see the Dockerfile as a reference).
|
||||||
|
Instruction on how to install fdroidserver [here](https://f-droid.org/docs/Installing_the_Server_and_Repo_Tools/)
|
||||||
|
|
||||||
|
## Alternatives
|
||||||
|
|
||||||
|
### YalpStore
|
||||||
|
|
||||||
|
[YalpStore](https://github.com/yeriomin/YalpStore) is an open source alternative to the play store.
|
||||||
|
It works very well and it requires you to install only the app, but it requires one of the
|
||||||
|
following thing to be able to install/update apks:
|
||||||
|
|
||||||
|
- enable **Unknown Sources**
|
||||||
|
- have **root** privileges
|
||||||
|
|
||||||
|
If you use playmaker and the fdroid [privileged extension](https://gitlab.com/fdroid/privileged-extension),
|
||||||
|
fdroid will be able to install/update app without root privileges or enabling unknown sources.
|
BIN
playmaker/example.png
Normal file
BIN
playmaker/example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
89
playmaker/playmaker/index.html
Normal file
89
playmaker/playmaker/index.html
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" ng-app="playmaker">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
<title>Playmaker</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||||
|
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
|
||||||
|
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
|
||||||
|
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
|
||||||
|
crossorigin="anonymous">
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
||||||
|
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
|
||||||
|
<link href="/static/app.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div ng-controller="navbar" class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle" data-toggle="collapse"
|
||||||
|
data-target=".navbar-responsive-collapse">
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button> <a class="navbar-brand">Playmaker</a>
|
||||||
|
</div>
|
||||||
|
<div class="navbar-collapse collapse navbar-responsive-collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li ng-class="{active: path === '/'}">
|
||||||
|
<a href="/#!/" id="app-page-link">
|
||||||
|
<i class="fab fa-android" aria-hidden="true"></i> Apps
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li ng-class="{active: path === '/search'}">
|
||||||
|
<a href="/#!/search" id="search-page-link">
|
||||||
|
<i class="fas fa-search" aria-hidden="true"></i> Search
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<li>
|
||||||
|
<a href=
|
||||||
|
"https://github.com/NoMore201/playmaker/releases/tag/v0.6.4">v0.6.4</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://github.com/NoMore201/playmaker">
|
||||||
|
<i class="fab fa-github" aria-hidden="true"></i> Source
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="notification-panel" ng-controller="notify">
|
||||||
|
<script type="text/ng-template" id="alert.html">
|
||||||
|
<div ng-transclude></div>
|
||||||
|
</script>
|
||||||
|
<div uib-alert="" ng-repeat="alert in alerts" ng-class=
|
||||||
|
"'alert-' + (alert.type || 'warning')" close="closeAlert($index)"
|
||||||
|
dismiss-on-timeout="3000">
|
||||||
|
{{alert.msg}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-view=""></div>
|
||||||
|
|
||||||
|
<!-- angular libraries -->
|
||||||
|
<script src="/static/js/angular-route.min.js"></script>
|
||||||
|
<script src="/static/js/angular-animate.min.js"></script>
|
||||||
|
<script src="/static/js/angular-touch.min.js"></script>
|
||||||
|
<script src="/static/js/ui-bootstrap.min.js"></script>
|
||||||
|
<script src="/static/js/additional.js"></script>
|
||||||
|
<!-- crypto library -->
|
||||||
|
|
||||||
|
<script src="/static/js/crypto-js.js"></script>
|
||||||
|
|
||||||
|
<script src="/static/app.module.js"></script>
|
||||||
|
<script src="/static/app.service.js"></script>
|
||||||
|
<script src="/static/app.controller.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
151
playmaker/playmaker/server.py
Normal file
151
playmaker/playmaker/server.py
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
import os
|
||||||
|
import tornado
|
||||||
|
|
||||||
|
from tornado import web
|
||||||
|
from tornado.concurrent import run_on_executor
|
||||||
|
from tornado.web import MissingArgumentError
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
|
|
||||||
|
app_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
static_dir = os.path.join(app_dir, 'static')
|
||||||
|
fdroid_instance = {}
|
||||||
|
|
||||||
|
|
||||||
|
def createServer(service):
|
||||||
|
|
||||||
|
class HomeHandler(web.RequestHandler):
|
||||||
|
def get(self):
|
||||||
|
with open(app_dir + '/index.html', 'r') as f:
|
||||||
|
self.write(f.read())
|
||||||
|
|
||||||
|
class ApiHandler(web.RequestHandler):
|
||||||
|
executor = ThreadPoolExecutor()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def get_apps(self):
|
||||||
|
return service.get_apps()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def get_last_fdroid_update(self):
|
||||||
|
return service.get_last_fdroid_update()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def search(self):
|
||||||
|
try:
|
||||||
|
keyword = self.get_argument('search')
|
||||||
|
except MissingArgumentError:
|
||||||
|
return None
|
||||||
|
return service.search(keyword)
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def login(self):
|
||||||
|
data = tornado.escape.json_decode(self.request.body)
|
||||||
|
service.set_encoded_credentials(data.get('email'), data.get('password'))
|
||||||
|
return service.login()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def download(self):
|
||||||
|
data = tornado.escape.json_decode(self.request.body)
|
||||||
|
if data.get('download') is None:
|
||||||
|
return None
|
||||||
|
return service.download_selection(data['download'])
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def check(self):
|
||||||
|
return service.check_local_apks()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def update_state(self):
|
||||||
|
service.update_state()
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def remove_app(self, app):
|
||||||
|
return service.remove_local_app(app)
|
||||||
|
|
||||||
|
@run_on_executor
|
||||||
|
def update_fdroid(self):
|
||||||
|
return service.fdroid_update()
|
||||||
|
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def get(self, path):
|
||||||
|
if path == 'apps':
|
||||||
|
apps = yield self.get_apps()
|
||||||
|
self.write(apps)
|
||||||
|
elif path == 'search':
|
||||||
|
apps = yield self.search()
|
||||||
|
if apps is not None:
|
||||||
|
self.write(apps)
|
||||||
|
else:
|
||||||
|
self.clear()
|
||||||
|
self.set_status(400, 'You should supply a valid search query')
|
||||||
|
elif path == 'fdroid':
|
||||||
|
result = yield self.get_last_fdroid_update()
|
||||||
|
self.write(result)
|
||||||
|
else:
|
||||||
|
self.set_status(404)
|
||||||
|
self.finish()
|
||||||
|
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def post(self, path):
|
||||||
|
if path == 'download':
|
||||||
|
result = yield self.download()
|
||||||
|
if result is None:
|
||||||
|
self.clear()
|
||||||
|
self.set_status(400)
|
||||||
|
else:
|
||||||
|
self.write(result)
|
||||||
|
elif path == 'check':
|
||||||
|
result = yield self.check()
|
||||||
|
self.write(result)
|
||||||
|
elif path == 'login':
|
||||||
|
result = yield self.login()
|
||||||
|
self.write(result)
|
||||||
|
if result['status'] == 'SUCCESS' and result['message'] == 'OK':
|
||||||
|
self.update_state()
|
||||||
|
elif path == 'fdroid':
|
||||||
|
global fdroid_instance
|
||||||
|
if fdroid_instance != {}:
|
||||||
|
self.write({'status': 'PENDING'})
|
||||||
|
else:
|
||||||
|
fdroid_instance = self
|
||||||
|
result = yield self.update_fdroid()
|
||||||
|
self.write(result)
|
||||||
|
fdroid_instance = {}
|
||||||
|
else:
|
||||||
|
self.set_status(404)
|
||||||
|
self.finish()
|
||||||
|
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def delete(self, path):
|
||||||
|
if path == 'delete':
|
||||||
|
data = tornado.escape.json_decode(self.request.body)
|
||||||
|
if data.get('delete') is None:
|
||||||
|
self.clear()
|
||||||
|
self.set_status(400)
|
||||||
|
else:
|
||||||
|
result = yield self.remove_app(data['delete'])
|
||||||
|
self.write(result)
|
||||||
|
else:
|
||||||
|
self.set_status(404)
|
||||||
|
self.finish()
|
||||||
|
|
||||||
|
if service.fdroid:
|
||||||
|
app = web.Application([
|
||||||
|
(r'/', HomeHandler),
|
||||||
|
(r'/api/(.*?)/?', ApiHandler),
|
||||||
|
(r'/fdroid/(.*)', web.StaticFileHandler, {'path': service.download_path}),
|
||||||
|
(r'/static/(.*)', web.StaticFileHandler, {'path': static_dir}),
|
||||||
|
(r'/views/(.*)', web.StaticFileHandler, {'path': app_dir + '/views'}),
|
||||||
|
], debug=False)
|
||||||
|
else:
|
||||||
|
app = web.Application([
|
||||||
|
(r'/', HomeHandler),
|
||||||
|
(r'/api/(.*?)/?', ApiHandler),
|
||||||
|
(r'/static/(.*)', web.StaticFileHandler, {'path': static_dir}),
|
||||||
|
(r'/views/(.*)', web.StaticFileHandler, {'path': app_dir + '/views'}),
|
||||||
|
], debug=False)
|
||||||
|
|
||||||
|
# overwrite settings
|
||||||
|
app.settings['static_path'] = ''
|
||||||
|
return app
|
385
playmaker/playmaker/service.py
Normal file
385
playmaker/playmaker/service.py
Normal file
@ -0,0 +1,385 @@
|
|||||||
|
from gpapi.googleplay import GooglePlayAPI, LoginError, RequestError, SecurityCheckError
|
||||||
|
from pyaxmlparser import APK
|
||||||
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import concurrent.futures
|
||||||
|
import locale as locale_service
|
||||||
|
from datetime import datetime as dt
|
||||||
|
|
||||||
|
NOT_LOGGED_IN_ERR = 'Not logged in'
|
||||||
|
WRONG_CREDENTIALS_ERR = 'Wrong credentials'
|
||||||
|
SESSION_EXPIRED_ERR = 'Session tokens expired, re-login needed'
|
||||||
|
FDROID_ERR = 'Error while executing fdroidserver tool'
|
||||||
|
|
||||||
|
|
||||||
|
def makeError(message):
|
||||||
|
return {'status': 'ERROR',
|
||||||
|
'message': message}
|
||||||
|
|
||||||
|
|
||||||
|
def get_details_from_apk(apk, downloadPath, service):
|
||||||
|
if apk is not None:
|
||||||
|
filepath = os.path.join(downloadPath, apk)
|
||||||
|
try:
|
||||||
|
a = APK(filepath)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return None
|
||||||
|
print('Fetching details for %s' % a.package)
|
||||||
|
try:
|
||||||
|
details = service.details(a.package)
|
||||||
|
details['filename'] = apk
|
||||||
|
details['versionCode'] = int(a.version_code)
|
||||||
|
except RequestError as e:
|
||||||
|
print('Cannot fetch information for %s' % a.package)
|
||||||
|
print('Extracting basic information from package...')
|
||||||
|
return {'docid': a.package,
|
||||||
|
'filename': apk,
|
||||||
|
'versionCode': int(a.version_code),
|
||||||
|
'title': a.application}
|
||||||
|
print('Added %s to cache' % details['docid'])
|
||||||
|
return details
|
||||||
|
|
||||||
|
|
||||||
|
class Play(object):
|
||||||
|
def __init__(self, debug=True, fdroid=False):
|
||||||
|
self.currentSet = []
|
||||||
|
self.totalNumOfApps = 0
|
||||||
|
self.debug = debug
|
||||||
|
self.fdroid = fdroid
|
||||||
|
self.firstRun = True
|
||||||
|
self.loggedIn = False
|
||||||
|
self._email = None
|
||||||
|
self._passwd = None
|
||||||
|
self._gsfId = None
|
||||||
|
self._token = None
|
||||||
|
self._last_fdroid_update = None
|
||||||
|
|
||||||
|
# configuring download folder
|
||||||
|
if self.fdroid:
|
||||||
|
self.download_path = os.path.join(os.getcwd(), 'repo')
|
||||||
|
else:
|
||||||
|
self.download_path = os.getcwd()
|
||||||
|
|
||||||
|
# configuring fdroid data
|
||||||
|
if self.fdroid:
|
||||||
|
self.fdroid_exe = 'fdroid'
|
||||||
|
self.fdroid_path = os.getcwd()
|
||||||
|
self.fdroid_init()
|
||||||
|
|
||||||
|
# language settings
|
||||||
|
locale = os.environ.get('LANG_LOCALE')
|
||||||
|
if locale is None:
|
||||||
|
locale = locale_service.getdefaultlocale()[0]
|
||||||
|
timezone = os.environ.get('LANG_TIMEZONE')
|
||||||
|
if timezone is None:
|
||||||
|
timezone = 'Europe/Berlin'
|
||||||
|
device = os.environ.get('DEVICE_CODE')
|
||||||
|
if device is None:
|
||||||
|
self.service = GooglePlayAPI(locale, timezone)
|
||||||
|
else:
|
||||||
|
self.service = GooglePlayAPI(locale, timezone,
|
||||||
|
device_codename=device)
|
||||||
|
|
||||||
|
def fdroid_init(self):
|
||||||
|
found = False
|
||||||
|
for path in os.environ['PATH'].split(':'):
|
||||||
|
exe = os.path.join(path, self.fdroid_exe)
|
||||||
|
if os.path.isfile(exe):
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
if not found:
|
||||||
|
print('Please install fdroid')
|
||||||
|
sys.exit(1)
|
||||||
|
elif os.path.isfile('config.py'):
|
||||||
|
print('Repo already initalized, skipping init')
|
||||||
|
else:
|
||||||
|
p = Popen([self.fdroid_exe, 'init', '-v'], stdout=PIPE, stderr=PIPE)
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
if p.returncode != 0:
|
||||||
|
sys.stderr.write("error initializing fdroid repository " +
|
||||||
|
stderr.decode('utf-8'))
|
||||||
|
sys.exit(1)
|
||||||
|
# backup config.py
|
||||||
|
if self.debug:
|
||||||
|
print('Checking config.py file')
|
||||||
|
with open('config.py', 'r') as config_file:
|
||||||
|
content = config_file.readlines()
|
||||||
|
with open('config.py', 'w') as config_file:
|
||||||
|
# copy all the original content of config.py
|
||||||
|
# if the file was not modified with custom values, do it
|
||||||
|
modified = False
|
||||||
|
for line in content:
|
||||||
|
if '# playmaker' in line:
|
||||||
|
modified = True
|
||||||
|
config_file.write(line)
|
||||||
|
if not modified:
|
||||||
|
if self.debug:
|
||||||
|
print('Appending playmaker data to config.py')
|
||||||
|
config_file.write('\n# playmaker\nrepo_name = "playmaker"\n'
|
||||||
|
'repo_description = "repository managed with '
|
||||||
|
'playmaker https://github.com/NoMore201/playmaker"\n')
|
||||||
|
|
||||||
|
# ensure all folder and files are setup
|
||||||
|
p = Popen([self.fdroid_exe, 'update', '--create-key', '-v'], stdout=PIPE, stderr=PIPE)
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
if p.returncode != 0:
|
||||||
|
print('Skipping fdroid update')
|
||||||
|
else:
|
||||||
|
print('Fdroid repo initialized successfully')
|
||||||
|
|
||||||
|
def get_last_fdroid_update(self):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': str(self._last_fdroid_update)}
|
||||||
|
|
||||||
|
def fdroid_update(self):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
if self.fdroid:
|
||||||
|
try:
|
||||||
|
p = Popen([self.fdroid_exe, 'update', '-c', '--clean'],
|
||||||
|
stdout=PIPE, stderr=PIPE)
|
||||||
|
stdout, stderr = p.communicate()
|
||||||
|
if p.returncode != 0:
|
||||||
|
sys.stderr.write("error updating fdroid repository " +
|
||||||
|
stderr.decode('utf-8'))
|
||||||
|
return makeError(FDROID_ERR)
|
||||||
|
else:
|
||||||
|
print('Fdroid repo updated successfully')
|
||||||
|
self._last_fdroid_update = dt.today().replace(microsecond=0)
|
||||||
|
return {'status': 'SUCCESS'}
|
||||||
|
except Exception as e:
|
||||||
|
return makeError(FDROID_ERR)
|
||||||
|
else:
|
||||||
|
return {'status': 'SUCCESS'}
|
||||||
|
|
||||||
|
def get_apps(self):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
|
||||||
|
if self.firstRun:
|
||||||
|
return {'status': 'PENDING',
|
||||||
|
'total': self.totalNumOfApps,
|
||||||
|
'current': len(self.currentSet)}
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': sorted(self.currentSet, key=lambda k: k['title'])}
|
||||||
|
|
||||||
|
def set_encoded_credentials(self, email, password):
|
||||||
|
self._email = base64.b64decode(email).decode('utf-8')
|
||||||
|
self._passwd = base64.b64decode(password).decode('utf-8')
|
||||||
|
|
||||||
|
def set_credentials(self, email, password):
|
||||||
|
self._email = email
|
||||||
|
self._passwd = password
|
||||||
|
|
||||||
|
def set_token_credentials(self, gsfId, token):
|
||||||
|
self._gsfId = int(gsfId, 16)
|
||||||
|
self._token = token
|
||||||
|
|
||||||
|
def has_credentials(self):
|
||||||
|
passwd_credentials = self._email is not None and self._passwd is not None
|
||||||
|
token_credentials = self._gsfId is not None and self._token is not None
|
||||||
|
return passwd_credentials or token_credentials
|
||||||
|
|
||||||
|
def login(self):
|
||||||
|
if self.loggedIn:
|
||||||
|
return {'status': 'SUCCESS', 'securityCheck': False, 'message': 'OK'}
|
||||||
|
|
||||||
|
try:
|
||||||
|
if not self.has_credentials():
|
||||||
|
raise LoginError("missing credentials")
|
||||||
|
self.service.login(self._email,
|
||||||
|
self._passwd,
|
||||||
|
self._gsfId,
|
||||||
|
self._token)
|
||||||
|
self.loggedIn = True
|
||||||
|
return {'status': 'SUCCESS', 'securityCheck': False, 'message': 'OK'}
|
||||||
|
except LoginError as e:
|
||||||
|
print('LoginError: {0}'.format(e))
|
||||||
|
self.loggedIn = False
|
||||||
|
return {'status': 'ERROR',
|
||||||
|
'securityCheck': False,
|
||||||
|
'message': 'Wrong credentials'}
|
||||||
|
except SecurityCheckError as e:
|
||||||
|
print('SecurityCheckError: {0}'.format(e))
|
||||||
|
self.loggedIn = False
|
||||||
|
return {'status': 'ERROR',
|
||||||
|
'securityCheck': True,
|
||||||
|
'message': 'Need security check'}
|
||||||
|
except RequestError as e:
|
||||||
|
# probably tokens are invalid, so it is better to
|
||||||
|
# invalidate them
|
||||||
|
print('RequestError: {0}'.format(e))
|
||||||
|
self.loggedIn = False
|
||||||
|
return {'status': 'ERROR',
|
||||||
|
'securityCheck': False,
|
||||||
|
'message': 'Request error, probably invalid token'}
|
||||||
|
|
||||||
|
def update_state(self):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
|
||||||
|
print('Updating cache')
|
||||||
|
with concurrent.futures.ProcessPoolExecutor() as executor:
|
||||||
|
# get application ids from apk files
|
||||||
|
apkFiles = [apk for apk in os.listdir(self.download_path)
|
||||||
|
if os.path.splitext(apk)[1] == '.apk']
|
||||||
|
self.totalNumOfApps = len(apkFiles)
|
||||||
|
if self.totalNumOfApps != 0:
|
||||||
|
future_to_app = [executor.submit(get_details_from_apk,
|
||||||
|
a,
|
||||||
|
self.download_path,
|
||||||
|
self.service)
|
||||||
|
for a in apkFiles]
|
||||||
|
for future in concurrent.futures.as_completed(future_to_app):
|
||||||
|
app = future.result()
|
||||||
|
if app is not None:
|
||||||
|
self.currentSet.append(app)
|
||||||
|
print('Cache correctly initialized')
|
||||||
|
self.firstRun = False
|
||||||
|
|
||||||
|
def insert_app_into_state(self, newApp):
|
||||||
|
found = False
|
||||||
|
result = list(filter(lambda x: x['docid'] == newApp['docid'],
|
||||||
|
self.currentSet))
|
||||||
|
if len(result) > 0:
|
||||||
|
found = True
|
||||||
|
if self.debug:
|
||||||
|
print('%s is already cached, updating..' % newApp['docid'])
|
||||||
|
i = self.currentSet.index(result[0])
|
||||||
|
self.currentSet[i] = newApp
|
||||||
|
if not found:
|
||||||
|
if self.debug:
|
||||||
|
print('Adding %s into cache..' % newApp['docid'])
|
||||||
|
self.currentSet.append(newApp)
|
||||||
|
|
||||||
|
def search(self, appName, numItems=15):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
|
||||||
|
try:
|
||||||
|
apps = self.service.search(appName)
|
||||||
|
except RequestError as e:
|
||||||
|
print(e)
|
||||||
|
self.loggedIn = False
|
||||||
|
return {'status': 'ERROR',
|
||||||
|
'message': SESSION_EXPIRED_ERR}
|
||||||
|
except LoginError as e:
|
||||||
|
print(SESSION_EXPIRED_ERR)
|
||||||
|
self.loggedIn = False
|
||||||
|
except IndexError as e:
|
||||||
|
print(SESSION_EXPIRED_ERR)
|
||||||
|
self.loggedIn = False
|
||||||
|
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': apps}
|
||||||
|
|
||||||
|
def details(self, app):
|
||||||
|
try:
|
||||||
|
details = self.service.details(app)
|
||||||
|
except RequestError:
|
||||||
|
details = None
|
||||||
|
return details
|
||||||
|
|
||||||
|
def get_bulk_details(self, apksList):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
try:
|
||||||
|
apps = [self.details(a) for a in apksList]
|
||||||
|
except LoginError as e:
|
||||||
|
print(e)
|
||||||
|
self.loggedIn = False
|
||||||
|
return apps
|
||||||
|
|
||||||
|
def download_selection(self, apps):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
success = []
|
||||||
|
failed = []
|
||||||
|
unavail = []
|
||||||
|
|
||||||
|
for app in apps:
|
||||||
|
docid = app.get('docid')
|
||||||
|
details = self.details(docid)
|
||||||
|
filename = app.get('filename')
|
||||||
|
if filename is None:
|
||||||
|
filename = details.get('docid') + '.apk'
|
||||||
|
if details is None:
|
||||||
|
print('Package %s does not exits' % docid)
|
||||||
|
unavail.append(docid)
|
||||||
|
continue
|
||||||
|
print('Downloading %s' % docid)
|
||||||
|
try:
|
||||||
|
if details.get('offer')[0].get('micros') == 0:
|
||||||
|
data_gen = self.service.download(docid, details.get('details').get('appDetails')['versionCode'])
|
||||||
|
else:
|
||||||
|
data_gen = self.service.delivery(docid, details.get('details').get('appDetails')['versionCode'])
|
||||||
|
data_gen = data_gen.get('file').get('data')
|
||||||
|
except IndexError as exc:
|
||||||
|
print(exc)
|
||||||
|
print('Package %s does not exists' % docid)
|
||||||
|
unavail.append(docid)
|
||||||
|
except Exception as exc:
|
||||||
|
print(exc)
|
||||||
|
print('Failed to download %s' % docid)
|
||||||
|
failed.append(docid)
|
||||||
|
else:
|
||||||
|
filepath = os.path.join(self.download_path, filename)
|
||||||
|
try:
|
||||||
|
with open(filepath, 'wb') as apk_file:
|
||||||
|
for chunk in data_gen:
|
||||||
|
apk_file.write(chunk)
|
||||||
|
except IOError as exc:
|
||||||
|
print('Error while writing %s: %s' % (filename, exc))
|
||||||
|
failed.append(docid)
|
||||||
|
details['filename'] = filename
|
||||||
|
success.append(details)
|
||||||
|
for x in success:
|
||||||
|
self.insert_app_into_state(x)
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': {'success': success,
|
||||||
|
'failed': failed,
|
||||||
|
'unavail': unavail}}
|
||||||
|
|
||||||
|
def check_local_apks(self):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
if len(self.currentSet) == 0:
|
||||||
|
print('There is no package')
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': []}
|
||||||
|
else:
|
||||||
|
toUpdate = []
|
||||||
|
for app in self.currentSet:
|
||||||
|
details = self.details(app.get('docid'))
|
||||||
|
#print(details)
|
||||||
|
if details is None:
|
||||||
|
print('%s not available in Play Store' % app['docid'])
|
||||||
|
continue
|
||||||
|
details['filename'] = app.get('filename')
|
||||||
|
if self.debug:
|
||||||
|
print('Checking %s' % app['docid'])
|
||||||
|
print('%d == %d ?' % (app.get('details').get('appDetails')['versionCode'], details.get('details').get('appDetails')['versionCode']))
|
||||||
|
if app.get('details').get('appDetails')['versionCode'] != details.get('details').get('appDetails')['versionCode']:
|
||||||
|
toUpdate.append(details)
|
||||||
|
return {'status': 'SUCCESS',
|
||||||
|
'message': toUpdate}
|
||||||
|
|
||||||
|
def remove_local_app(self, docid):
|
||||||
|
if not self.loggedIn:
|
||||||
|
return {'status': 'UNAUTHORIZED'}
|
||||||
|
# get app from cache
|
||||||
|
app = list(filter(lambda x: x['docid'] == docid, self.currentSet))
|
||||||
|
if len(app) < 1:
|
||||||
|
return {'status': 'ERROR'}
|
||||||
|
apkPath = os.path.join(self.download_path, app[0]['filename'])
|
||||||
|
if os.path.isfile(apkPath):
|
||||||
|
os.remove(apkPath)
|
||||||
|
self.currentSet.remove(app[0])
|
||||||
|
return {'status': 'SUCCESS'}
|
||||||
|
return {'status': 'ERROR'}
|
28
playmaker/playmaker/static/app.controller.js
Normal file
28
playmaker/playmaker/static/app.controller.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
angular.module('playmaker').controller('notify', [
|
||||||
|
'$scope',
|
||||||
|
'global',
|
||||||
|
function($scope, global) {
|
||||||
|
$scope.alerts = [];
|
||||||
|
|
||||||
|
$scope.closeAlert = function(index) {
|
||||||
|
$scope.alerts.splice(index, 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
global.addAlert = function(type, msg) {
|
||||||
|
newAlert = {
|
||||||
|
type: type,
|
||||||
|
msg: msg
|
||||||
|
};
|
||||||
|
$scope.alerts.push(newAlert);
|
||||||
|
};
|
||||||
|
}]);
|
||||||
|
|
||||||
|
angular.module('playmaker').controller('navbar', [
|
||||||
|
'$location',
|
||||||
|
'$scope',
|
||||||
|
'$rootScope',
|
||||||
|
function($location, $scope, $rootScope) {
|
||||||
|
$rootScope.$on('$routeChangeSuccess', function() {
|
||||||
|
$scope.path = $location.path();
|
||||||
|
});
|
||||||
|
}]);
|
177
playmaker/playmaker/static/app.css
Normal file
177
playmaker/playmaker/static/app.css
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
/*
|
||||||
|
* index.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
.navbar-fixed-top {
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-panel {
|
||||||
|
position: fixed;
|
||||||
|
right: 30px;
|
||||||
|
top: 75px;
|
||||||
|
width: 300px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Login view
|
||||||
|
*/
|
||||||
|
|
||||||
|
.login-body {
|
||||||
|
margin:0 auto;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-login {
|
||||||
|
max-width: 500px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-login-text {
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Apps view
|
||||||
|
*/
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 71px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-list-el {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
height:50px;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left:15px;
|
||||||
|
padding-right:15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-container {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-body {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apk-item-title {
|
||||||
|
display: block;
|
||||||
|
font-size: 22px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
margin-top:10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apk-info {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apk-buttons {
|
||||||
|
display: block;
|
||||||
|
padding:15px;
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apk-buttons > a {
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apk-progress {
|
||||||
|
margin:24px 15px 18px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search view
|
||||||
|
*/
|
||||||
|
|
||||||
|
.view-container {
|
||||||
|
max-width: 1000px;
|
||||||
|
margin:0 auto;
|
||||||
|
margin-top: 81px;
|
||||||
|
padding:0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl-button {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl-button:hover {
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl-button-disabled {
|
||||||
|
cursor: default;
|
||||||
|
pointer-event: none;
|
||||||
|
color: #BABABA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl-button-disabled:hover {
|
||||||
|
color: #BABABA;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dl-button-td {
|
||||||
|
width:80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-progress {
|
||||||
|
margin-top:40px;
|
||||||
|
margin-left:30px;
|
||||||
|
margin-right:30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#search-area {
|
||||||
|
padding:0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
margin-top:40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table-body > tr {
|
||||||
|
line-height: 70px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table-body > tr > td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.sidebar {
|
||||||
|
background-color:#f7f7f7;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
margin:0;
|
||||||
|
padding-top:30px;
|
||||||
|
position: fixed;
|
||||||
|
top: 51px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-container {
|
||||||
|
margin-left:300px;
|
||||||
|
margin-top: 81px;
|
||||||
|
max-width: 1200px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
347
playmaker/playmaker/static/app.module.js
Normal file
347
playmaker/playmaker/static/app.module.js
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
var app = angular.module('playmaker', [
|
||||||
|
'ngRoute',
|
||||||
|
'ui.bootstrap'
|
||||||
|
]);
|
||||||
|
|
||||||
|
app.config(['$locationProvider', '$routeProvider',
|
||||||
|
function config($locationProvider, $routeProvider) {
|
||||||
|
|
||||||
|
$routeProvider.
|
||||||
|
when('/', {
|
||||||
|
template: '<app-list></app-list>'
|
||||||
|
}).
|
||||||
|
when('/search', {
|
||||||
|
template: '<search-view></search-view>'
|
||||||
|
}).
|
||||||
|
when('/login', {
|
||||||
|
template: '<login-view></login-view>'
|
||||||
|
}).
|
||||||
|
otherwise('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
]).run(['$rootScope', '$location', 'api', 'global',
|
||||||
|
function ($rootScope, $location, api, global) {
|
||||||
|
|
||||||
|
api.getApps(function(response) {
|
||||||
|
if (response.status === 'SUCCESS') {
|
||||||
|
global.auth.login();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response === 'err' || !global.auth.isLoggedIn()) {
|
||||||
|
$location.path('/login');
|
||||||
|
} else {
|
||||||
|
// redirect home
|
||||||
|
$location.path('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
$rootScope.$on('$routeChangeStart', function (event, next, current) {
|
||||||
|
if (!global.auth.isLoggedIn() && $location.path() !== '/login') {
|
||||||
|
event.preventDefault();
|
||||||
|
$location.path('/login');
|
||||||
|
} else if (global.auth.isLoggedIn() && $location.path() === '/login') {
|
||||||
|
// redirect home
|
||||||
|
event.preventDefault();
|
||||||
|
$location.path('/');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
app.component('appList', {
|
||||||
|
templateUrl: '/views/app.html',
|
||||||
|
controller: function AppController(api, global, $location) {
|
||||||
|
var ctrl = this;
|
||||||
|
|
||||||
|
ctrl.apps = [];
|
||||||
|
ctrl.lastFdroidUpdate = 'None';
|
||||||
|
ctrl.desktop = global.desktop;
|
||||||
|
ctrl.mobile = global.mobile;
|
||||||
|
var port = $location.port();
|
||||||
|
ctrl.baseUrl = $location.protocol() + '://' + $location.host();
|
||||||
|
if (port !== 80 && port !== 443) {
|
||||||
|
ctrl.baseUrl += ":" + port.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
var updateApp = function(app) {
|
||||||
|
app.updating = true;
|
||||||
|
api.download(app, function(data) {
|
||||||
|
if (data === 'err' || data.status === 'ERROR') {
|
||||||
|
global.addAlert('danger', 'Unable to update ' + app.docid);
|
||||||
|
app.updating = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.message.success.length === 0) {
|
||||||
|
global.addAlert('danger', 'Unable to update ' + app.docid);
|
||||||
|
app.updating = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
app.versionCode = data.message.success[0].versionCode;
|
||||||
|
app.updating = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ctrl.check = function() {
|
||||||
|
global.addAlert('info', 'Checking for updates');
|
||||||
|
api.check(function(data) {
|
||||||
|
if (data === 'err') {
|
||||||
|
global.addAlert('danger', 'Cannot check for updates');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.status === 'SUCCESS' && data.message.length === 0) {
|
||||||
|
global.addAlert('success', 'All apps are up-to-date!');
|
||||||
|
}
|
||||||
|
if (data.status === 'SUCCESS' && data.message.length > 0) {
|
||||||
|
global.addAlert('success', 'Updating ' + data.message.length.toString() + ' apps');
|
||||||
|
|
||||||
|
data.message.forEach(function(newApp) {
|
||||||
|
var oldAppIndex = ctrl.apps.findIndex(function(elem) {
|
||||||
|
return elem.docid === newApp.docid
|
||||||
|
});
|
||||||
|
if (oldAppIndex === -1) return;
|
||||||
|
updateApp(ctrl.apps[oldAppIndex]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ctrl.delete = function(app) {
|
||||||
|
api.remove(app.docid, function(data) {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
var i = ctrl.apps.findIndex(function(elem) {
|
||||||
|
return elem.docid === app.docid;
|
||||||
|
});
|
||||||
|
ctrl.apps.splice(i, 1);
|
||||||
|
} else {
|
||||||
|
global.addAlert('danger', 'Unable to delete ' + app.docid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ctrl.fdroid = function() {
|
||||||
|
var oldUpdate = ctrl.lastFdroidUpdate;
|
||||||
|
ctrl.lastFdroidUpdate = 'Pending';
|
||||||
|
api.fdroidUpdate(function (data) {
|
||||||
|
if (data === 'err') {
|
||||||
|
global.addAlert('danger', 'Error updating repository');
|
||||||
|
ctrl.lastFdroidUpdate = oldUpdate;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.status === 'PENDING') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
api.fdroid(function(data) {
|
||||||
|
if (data.status !== 'SUCCESS') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctrl.lastFdroidUpdate = data.message;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
api.getApps(function(data) {
|
||||||
|
if (data.status === 'UNAUTHORIZED') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctrl.apps = data.message.map(function(a) {
|
||||||
|
if (a.aggregateRating !== undefined) {
|
||||||
|
roundedStars = Math.floor(a.aggregateRating.starRating);
|
||||||
|
a.formattedStars = a.aggregateRating.starRating.toFixed(1);
|
||||||
|
a.starList = [];
|
||||||
|
for (i = 0; i < 5; i++) {
|
||||||
|
if (i+1 <= roundedStars){
|
||||||
|
a.starList.push({index: i, full: true});
|
||||||
|
} else {
|
||||||
|
a.starList.push({index: i, full: false});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (a.image !== undefined) {
|
||||||
|
a.previewImage = a.image.filter(function(img) {
|
||||||
|
return img.imageType === 4;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (a.details.appDetails.installationSize !== undefined) {
|
||||||
|
a.formattedSize = a.details.appDetails.installationSize / (1024*1024);
|
||||||
|
a.formattedSize = a.formattedSize.toFixed(2);
|
||||||
|
}
|
||||||
|
if (a.author === undefined) {
|
||||||
|
a.author = "unknown";
|
||||||
|
}
|
||||||
|
if (a.files === undefined) {
|
||||||
|
a.files = ["unknown"];
|
||||||
|
}
|
||||||
|
a.updating = false;
|
||||||
|
return a;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
api.fdroid(function(data) {
|
||||||
|
if (data.status !== 'SUCCESS') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctrl.lastFdroidUpdate = data.message;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.directive('onEnter', function() {
|
||||||
|
return function(scope, element, attrs) {
|
||||||
|
element.bind("keydown keypress", function (event) {
|
||||||
|
if(event.which === 13) {
|
||||||
|
scope.$apply(function (){
|
||||||
|
scope.$eval(attrs.onEnter);
|
||||||
|
});
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
app.component('searchView', {
|
||||||
|
templateUrl: '/views/search.html',
|
||||||
|
controller: function SearchController($uibModal, api, global) {
|
||||||
|
var ctrl = this;
|
||||||
|
ctrl.desktop = global.desktop;
|
||||||
|
ctrl.mobile = global.mobile;
|
||||||
|
ctrl.results = [];
|
||||||
|
ctrl.searching = false;
|
||||||
|
|
||||||
|
ctrl.modalOpen = function (item) {
|
||||||
|
$uibModal.open({
|
||||||
|
animation: true,
|
||||||
|
ariaLabelledBy: 'modal-title',
|
||||||
|
ariaDescribedBy: 'modal-body',
|
||||||
|
templateUrl: 'myModalContent.html',
|
||||||
|
controller: function($scope) {
|
||||||
|
$scope.app = item;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ctrl.search = function(app) {
|
||||||
|
// no input by the user
|
||||||
|
if (app === undefined || app === '') return;
|
||||||
|
ctrl.results = [];
|
||||||
|
ctrl.searching = true;
|
||||||
|
api.search(app, function(data) {
|
||||||
|
if (data === 'err') {
|
||||||
|
global.addAlert('danger', 'Error while searching');
|
||||||
|
ctrl.searching = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.status === 'SUCCESS' && data.message.length === 0) {
|
||||||
|
global.addAlert('warning', 'No result for "' + app + '"');
|
||||||
|
ctrl.searching = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.message.forEach(function(d) {
|
||||||
|
d.downloading = false;
|
||||||
|
d.disabled = false;
|
||||||
|
});
|
||||||
|
ctrl.results = data.message[0].child[0].child;
|
||||||
|
ctrl.searching = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ctrl.download = function(app) {
|
||||||
|
if (app.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
app.downloading = true;
|
||||||
|
api.download(app, function(data) {
|
||||||
|
if (data === 'err') {
|
||||||
|
app.downloading = false;
|
||||||
|
global.addAlert('danger', 'Error downloading app');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (data.message.success.length === 0) {
|
||||||
|
app.downloading = false;
|
||||||
|
global.addAlert('warning', app.docid + ' can\'t be downloaded');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
app.downloading = false;
|
||||||
|
app.disabled = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.component('loginView', {
|
||||||
|
templateUrl: '/views/login.html',
|
||||||
|
controller: function LoginController($location, api, global) {
|
||||||
|
var ctrl = this;
|
||||||
|
ctrl.current = 0;
|
||||||
|
ctrl.max = -1;
|
||||||
|
ctrl.formattedPercent = 0;
|
||||||
|
ctrl.securityCheck = false;
|
||||||
|
var polling = function() {
|
||||||
|
api.getApps(function(response) {
|
||||||
|
if (response === 'err') {
|
||||||
|
ctrl.loggingIn = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (response.status === 'UNAUTHORIZED') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (response.status === 'PENDING') {
|
||||||
|
ctrl.loggingIn = true;
|
||||||
|
if (response.total !== 0) {
|
||||||
|
ctrl.max = response.total;
|
||||||
|
ctrl.current = response.current;
|
||||||
|
ctrl.formattedPercent = (ctrl.current / ctrl.max)*100;
|
||||||
|
ctrl.formattedPercent = ctrl.formattedPercent.toFixed(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response.status === 'SUCCESS') {
|
||||||
|
global.auth.login();
|
||||||
|
$location.path('/');
|
||||||
|
ctrl.loggingIn = false;
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
ctrl.loggingIn = false;
|
||||||
|
ctrl.badUsername = false;
|
||||||
|
ctrl.badPassword = false;
|
||||||
|
|
||||||
|
polling();
|
||||||
|
var interval = setInterval(polling, 3000);
|
||||||
|
|
||||||
|
|
||||||
|
ctrl.login = function(user) {
|
||||||
|
ctrl.badUsername = false;
|
||||||
|
ctrl.badPassword = false;
|
||||||
|
|
||||||
|
if (user.email === '' || user.email === undefined) {
|
||||||
|
ctrl.badUsername = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.password === '' || user.password === undefined) {
|
||||||
|
ctrl.badPassword = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctrl.loggingIn = true;
|
||||||
|
var email = CryptoJS.enc.Utf8.parse(user.email);
|
||||||
|
var passwd = CryptoJS.enc.Utf8.parse(user.password);
|
||||||
|
var emailB64 = CryptoJS.enc.Base64.stringify(email);
|
||||||
|
var passwdB64 = CryptoJS.enc.Base64.stringify(passwd);
|
||||||
|
api.login(emailB64, passwdB64, function(data) {
|
||||||
|
if (data.status === 'ERROR') {
|
||||||
|
global.addAlert('danger', data.message);
|
||||||
|
ctrl.loggingIn = false;
|
||||||
|
ctrl.securityCheck = data.securityCheck;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
150
playmaker/playmaker/static/app.service.js
Normal file
150
playmaker/playmaker/static/app.service.js
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
angular.module('playmaker').service('global', ['$http', function($http) {
|
||||||
|
|
||||||
|
function AuthManager() {
|
||||||
|
|
||||||
|
this.loggedIn = false;
|
||||||
|
|
||||||
|
this.isLoggedIn = function () {
|
||||||
|
return this.loggedIn;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.login = function () {
|
||||||
|
this.loggedIn = !this.loggedIn;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addAlert = {};
|
||||||
|
|
||||||
|
this.desktop = false;
|
||||||
|
this.mobile = false;
|
||||||
|
|
||||||
|
this.auth = new AuthManager();
|
||||||
|
|
||||||
|
var screenWidth = window.innerWidth;
|
||||||
|
if (screenWidth < 700) {
|
||||||
|
this.mobile = true;
|
||||||
|
} else {
|
||||||
|
this.desktop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
||||||
|
|
||||||
|
angular.module('playmaker').service('api', ['$http', '$location', 'global', function($http, $location, global) {
|
||||||
|
|
||||||
|
function loginHandler(result) {
|
||||||
|
if (result.data.status === 'ERROR') {
|
||||||
|
if (result.data.message !== undefined) {
|
||||||
|
global.addAlert('danger', result.data.message);
|
||||||
|
} else {
|
||||||
|
global.addAlert('danger', 'Application error');
|
||||||
|
}
|
||||||
|
global.auth.loggedIn = false;
|
||||||
|
$location.path('/login');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getApps = function(callback) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/apps'
|
||||||
|
}).then(function success(response) {
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.search = function(app, callback) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/search?search=' + app
|
||||||
|
}).then(function success(response) {
|
||||||
|
loginHandler(response);
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.check = function(callback) {
|
||||||
|
$http.post('/api/check')
|
||||||
|
.then(function success(response) {
|
||||||
|
loginHandler(response);
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.download = function(app, callback) {
|
||||||
|
var requestData = {
|
||||||
|
download: [app]
|
||||||
|
};
|
||||||
|
$http({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/download',
|
||||||
|
data: JSON.stringify(requestData)
|
||||||
|
}).then(function success(response) {
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.remove = function(app, callback) {
|
||||||
|
var requestData = {
|
||||||
|
delete: app
|
||||||
|
};
|
||||||
|
$http({
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/api/delete',
|
||||||
|
data: JSON.stringify(requestData)
|
||||||
|
}).then(function success(response) {
|
||||||
|
loginHandler(response);
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.fdroid = function(callback) {
|
||||||
|
$http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/fdroid'
|
||||||
|
}).then(function success(response) {
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.fdroidUpdate = function(callback) {
|
||||||
|
$http({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/fdroid'
|
||||||
|
}).then(function success(response) {
|
||||||
|
loginHandler(response);
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.login = function(email, password, callback) {
|
||||||
|
$http({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/login',
|
||||||
|
data: JSON.stringify({
|
||||||
|
email: email,
|
||||||
|
password: password
|
||||||
|
})
|
||||||
|
}).then(function success(response) {
|
||||||
|
callback(response.data);
|
||||||
|
}, function error(response) {
|
||||||
|
callback('err');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
5
playmaker/playmaker/static/js/additional.js
Normal file
5
playmaker/playmaker/static/js/additional.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
$(document).on('click', '.navbar-collapse.in', function(e) {
|
||||||
|
if($(e.target).is('a')) {
|
||||||
|
$(this).collapse('hide');
|
||||||
|
}
|
||||||
|
});
|
58
playmaker/playmaker/static/js/angular-animate.min.js
vendored
Normal file
58
playmaker/playmaker/static/js/angular-animate.min.js
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
AngularJS v1.7.5
|
||||||
|
(c) 2010-2018 Google, Inc. http://angularjs.org
|
||||||
|
License: MIT
|
||||||
|
*/
|
||||||
|
(function(Y,z){'use strict';function Fa(a,b,c){if(!a)throw Pa("areq",b||"?",c||"required");return a}function Ga(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;Z(a)&&(a=a.join(" "));Z(b)&&(b=b.join(" "));return a+" "+b}function Qa(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function $(a,b,c){var d="";a=Z(a)?a:a&&G(a)&&a.length?a.split(/\s+/):[];s(a,function(a,k){a&&0<a.length&&(d+=0<k?" ":"",d+=c?b+a:a+b)});return d}function Ha(a){if(a instanceof A)switch(a.length){case 0:return a;
|
||||||
|
case 1:if(1===a[0].nodeType)return a;break;default:return A(va(a))}if(1===a.nodeType)return A(a)}function va(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1===c.nodeType)return c}}function Ra(a,b,c){s(b,function(b){a.addClass(b,c)})}function Sa(a,b,c){s(b,function(b){a.removeClass(b,c)})}function aa(a){return function(b,c){c.addClass&&(Ra(a,b,c.addClass),c.addClass=null);c.removeClass&&(Sa(a,b,c.removeClass),c.removeClass=null)}}function pa(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
|
||||||
|
N;a.domOperation=function(){a.$$domOperationFired=!0;b();b=N};a.$$prepared=!0}return a}function ha(a,b){Ia(a,b);Ja(a,b)}function Ia(a,b){b.from&&(a.css(b.from),b.from=null)}function Ja(a,b){b.to&&(a.css(b.to),b.to=null)}function T(a,b,c){var d=b.options||{};c=c.options||{};var f=(d.addClass||"")+" "+(c.addClass||""),k=(d.removeClass||"")+" "+(c.removeClass||"");a=Ta(a.attr("class"),f,k);c.preparationClasses&&(d.preparationClasses=ba(c.preparationClasses,d.preparationClasses),delete c.preparationClasses);
|
||||||
|
f=d.domOperation!==N?d.domOperation:null;wa(d,c);f&&(d.domOperation=f);d.addClass=a.addClass?a.addClass:null;d.removeClass=a.removeClass?a.removeClass:null;b.addClass=d.addClass;b.removeClass=d.removeClass;return d}function Ta(a,b,c){function d(a){G(a)&&(a=a.split(" "));var c={};s(a,function(a){a.length&&(c[a]=!0)});return c}var f={};a=d(a);b=d(b);s(b,function(a,c){f[c]=1});c=d(c);s(c,function(a,c){f[c]=1===f[c]?null:-1});var k={addClass:"",removeClass:""};s(f,function(c,b){var d,f;1===c?(d="addClass",
|
||||||
|
f=!a[b]||a[b+"-remove"]):-1===c&&(d="removeClass",f=a[b]||a[b+"-add"]);f&&(k[d].length&&(k[d]+=" "),k[d]+=b)});return k}function K(a){return a instanceof A?a[0]:a}function Ua(a,b,c,d){a="";c&&(a=$(c,"ng-",!0));d.addClass&&(a=ba(a,$(d.addClass,"-add")));d.removeClass&&(a=ba(a,$(d.removeClass,"-remove")));a.length&&(d.preparationClasses=a,b.addClass(a))}function qa(a,b){var c=b?"-"+b+"s":"";ma(a,[na,c]);return[na,c]}function xa(a,b){var c=b?"paused":"",d=ca+"PlayState";ma(a,[d,c]);return[d,c]}function ma(a,
|
||||||
|
b){a.style[b[0]]=b[1]}function ba(a,b){return a?b?a+" "+b:a:b}function Ka(a,b,c){var d=Object.create(null),f=a.getComputedStyle(b)||{};s(c,function(a,c){var b=f[a];if(b){var L=b.charAt(0);if("-"===L||"+"===L||0<=L)b=Va(b);0===b&&(b=null);d[c]=b}});return d}function Va(a){var b=0;a=a.split(/\s*,\s*/);s(a,function(a){"s"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function ya(a){return 0===a||null!=a}function La(a,b){var c=M,d=a+"s";b?c+="Duration":
|
||||||
|
d+=" linear all";return[c,d]}function Ma(a,b,c){s(c,function(c){a[c]=za(a[c])?a[c]:b.style.getPropertyValue(c)})}var M,Aa,ca,Ba;void 0===Y.ontransitionend&&void 0!==Y.onwebkittransitionend?(M="WebkitTransition",Aa="webkitTransitionEnd transitionend"):(M="transition",Aa="transitionend");void 0===Y.onanimationend&&void 0!==Y.onwebkitanimationend?(ca="WebkitAnimation",Ba="webkitAnimationEnd animationend"):(ca="animation",Ba="animationend");var ra=ca+"Delay",Ca=ca+"Duration",na=M+"Delay",Na=M+"Duration",
|
||||||
|
Pa=z.$$minErr("ng"),Wa={transitionDuration:Na,transitionDelay:na,transitionProperty:M+"Property",animationDuration:Ca,animationDelay:ra,animationIterationCount:ca+"IterationCount"},Xa={transitionDuration:Na,transitionDelay:na,animationDuration:Ca,animationDelay:ra},Da,wa,s,Z,za,sa,Ea,ta,G,R,A,N;z.module("ngAnimate",[],function(){N=z.noop;Da=z.copy;wa=z.extend;A=z.element;s=z.forEach;Z=z.isArray;G=z.isString;ta=z.isObject;R=z.isUndefined;za=z.isDefined;Ea=z.isFunction;sa=z.isElement}).info({angularVersion:"1.7.5"}).directive("ngAnimateSwap",
|
||||||
|
["$animate",function(a){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(b,c,d,f,k){var e,Q;b.$watchCollection(d.ngAnimateSwap||d["for"],function(b){e&&a.leave(e);Q&&(Q.$destroy(),Q=null);(b||0===b)&&k(function(b,d){e=b;Q=d;a.enter(b,null,c)})})}}}]).directive("ngAnimateChildren",["$interpolate",function(a){return{link:function(b,c,d){function f(a){c.data("$$ngAnimateChildren","on"===a||"true"===a)}var k=d.ngAnimateChildren;G(k)&&0===k.length?c.data("$$ngAnimateChildren",
|
||||||
|
!0):(f(a(k)(b)),d.$observe("ngAnimateChildren",f))}}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),e=0;e<b.length;e++)b[e]();f||a(function(){f||c()})}}var d,f;d=b.queue=[];b.waitUntilQuiet=function(b){f&&f();f=a(function(){f=null;b();c()})};return b}]).provider("$$animateQueue",["$animateProvider",function(a){function b(a){return{addClass:a.addClass,removeClass:a.removeClass,from:a.from,to:a.to}}function c(a){if(!a)return null;
|
||||||
|
a=a.split(" ");var b=Object.create(null);s(a,function(a){b[a]=!0});return b}function d(a,b){if(a&&b){var d=c(b);return a.split(" ").some(function(a){return d[a]})}}function f(a,b,c){return e[a].some(function(a){return a(b,c)})}function k(a,b){var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var e=this.rules={skip:[],cancel:[],join:[]};e.join.push(function(a,b){return!a.structural&&k(a)});e.skip.push(function(a,b){return!a.structural&&!k(a)});e.skip.push(function(a,
|
||||||
|
b){return"leave"===b.event&&a.structural});e.skip.push(function(a,b){return b.structural&&2===b.state&&!a.structural});e.cancel.push(function(a,b){return b.structural&&a.structural});e.cancel.push(function(a,b){return 2===b.state&&a.structural});e.cancel.push(function(a,b){if(b.structural)return!1;var c=a.addClass,f=a.removeClass,k=b.addClass,e=b.removeClass;return R(c)&&R(f)||R(k)&&R(e)?!1:d(c,e)||d(f,k)});this.$get=["$$rAF","$rootScope","$rootElement","$document","$$Map","$$animation","$$AnimateRunner",
|
||||||
|
"$templateRequest","$$jqLite","$$forceReflow","$$isDocumentHidden",function(c,d,e,C,U,oa,H,u,t,I,da){function ia(a){O.delete(a.target)}function v(){var a=!1;return function(b){a?b():d.$$postDigest(function(){a=!0;b()})}}function ua(a,b,c){var g=[],l=m[c];l&&s(l,function(l){Oa.call(l.node,b)?g.push(l.callback):"leave"===c&&Oa.call(l.node,a)&&g.push(l.callback)});return g}function h(a,b,c){var l=va(b);return a.filter(function(a){return!(a.node===l&&(!c||a.callback===c))})}function q(a,J,w){function e(a,
|
||||||
|
b,l,g){u(function(){var a=ua(ia,m,b);a.length?c(function(){s(a,function(a){a(h,l,g)});"close"!==l||m.parentNode||D.off(m)}):"close"!==l||m.parentNode||D.off(m)});a.progress(b,l,g)}function I(a){var b=h,c=n;c.preparationClasses&&(b.removeClass(c.preparationClasses),c.preparationClasses=null);c.activeClasses&&(b.removeClass(c.activeClasses),c.activeClasses=null);W(h,n);ha(h,n);n.domOperation();q.complete(!a)}var n=Da(w),h=Ha(a),m=K(h),ia=m&&m.parentNode,n=pa(n),q=new H,u=v();Z(n.addClass)&&(n.addClass=
|
||||||
|
n.addClass.join(" "));n.addClass&&!G(n.addClass)&&(n.addClass=null);Z(n.removeClass)&&(n.removeClass=n.removeClass.join(" "));n.removeClass&&!G(n.removeClass)&&(n.removeClass=null);n.from&&!ta(n.from)&&(n.from=null);n.to&&!ta(n.to)&&(n.to=null);if(!(B&&m&&fa(m,J,w)&&Ya(m,n)))return I(),q;var x=0<=["enter","move","leave"].indexOf(J),r=da(),P=r||O.get(m);w=!P&&y.get(m)||{};var p=!!w.state;P||p&&1===w.state||(P=!E(m,ia,J));if(P)return r&&e(q,J,"start",b(n)),I(),r&&e(q,J,"close",b(n)),q;x&&F(m);r={structural:x,
|
||||||
|
element:h,event:J,addClass:n.addClass,removeClass:n.removeClass,close:I,options:n,runner:q};if(p){if(f("skip",r,w)){if(2===w.state)return I(),q;T(h,w,r);return w.runner}if(f("cancel",r,w))if(2===w.state)w.runner.end();else if(w.structural)w.close();else return T(h,w,r),w.runner;else if(f("join",r,w))if(2===w.state)T(h,r,{});else return Ua(t,h,x?J:null,n),J=r.event=w.event,n=T(h,w,r),w.runner}else T(h,r,{});(p=r.structural)||(p="animate"===r.event&&0<Object.keys(r.options.to||{}).length||k(r));if(!p)return I(),
|
||||||
|
g(m),q;var C=(w.counter||0)+1;r.counter=C;l(m,1,r);d.$$postDigest(function(){h=Ha(a);var c=y.get(m),d=!c,c=c||{},t=0<(h.parent()||[]).length&&("animate"===c.event||c.structural||k(c));if(d||c.counter!==C||!t){d&&(W(h,n),ha(h,n));if(d||x&&c.event!==J)n.domOperation(),q.end();t||g(m)}else J=!c.structural&&k(c,!0)?"setClass":c.event,l(m,2),c=oa(h,J,c.options),q.setHost(c),e(q,J,"start",b(n)),c.done(function(a){I(!a);(a=y.get(m))&&a.counter===C&&g(m);e(q,J,"close",b(n))})});return q}function F(a){a=a.querySelectorAll("[data-ng-animate]");
|
||||||
|
s(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate"),10),c=y.get(a);if(c)switch(b){case 2:c.runner.end();case 1:y.delete(a)}})}function g(a){a.removeAttribute("data-ng-animate");y.delete(a)}function E(a,b,c){c=C[0].body;var l=K(e),g=a===c||"HTML"===a.nodeName,d=a===l,t=!1,m=O.get(a),h;for((a=A.data(a,"$ngAnimatePin"))&&(b=K(a));b;){d||(d=b===l);if(1!==b.nodeType)break;a=y.get(b)||{};if(!t){var f=O.get(b);if(!0===f&&!1!==m){m=!0;break}else!1===f&&(m=!1);t=a.structural}if(R(h)||!0===h)a=
|
||||||
|
A.data(b,"$$ngAnimateChildren"),za(a)&&(h=a);if(t&&!1===h)break;g||(g=b===c);if(g&&d)break;if(!d&&(a=A.data(b,"$ngAnimatePin"))){b=K(a);continue}b=b.parentNode}return(!t||h)&&!0!==m&&d&&g}function l(a,b,c){c=c||{};c.state=b;a.setAttribute("data-ng-animate",b);c=(b=y.get(a))?wa(b,c):c;y.set(a,c)}var y=new U,O=new U,B=null,P=d.$watch(function(){return 0===u.totalPendingRequests},function(a){a&&(P(),d.$$postDigest(function(){d.$$postDigest(function(){null===B&&(B=!0)})}))}),m=Object.create(null);U=a.customFilter();
|
||||||
|
var la=a.classNameFilter();I=function(){return!0};var fa=U||I,Ya=la?function(a,b){var c=[a.getAttribute("class"),b.addClass,b.removeClass].join(" ");return la.test(c)}:I,W=aa(t),Oa=Y.Node.prototype.contains||function(a){return this===a||!!(this.compareDocumentPosition(a)&16)},D={on:function(a,b,c){var l=va(b);m[a]=m[a]||[];m[a].push({node:l,callback:c});A(b).on("$destroy",function(){y.get(l)||D.off(a,b,c)})},off:function(a,b,c){if(1!==arguments.length||G(arguments[0])){var l=m[a];l&&(m[a]=1===arguments.length?
|
||||||
|
null:h(l,b,c))}else for(l in b=arguments[0],m)m[l]=h(m[l],b)},pin:function(a,b){Fa(sa(a),"element","not an element");Fa(sa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,l){c=c||{};c.domOperation=l;return q(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!B;else if(sa(a)){var l=K(a);if(1===c)b=!O.get(l);else{if(!O.has(l))A(a).on("$destroy",ia);O.set(l,!b)}}else b=B=!!a;return b}};return D}]}]).provider("$$animateCache",function(){var a=0,b=Object.create(null);
|
||||||
|
this.$get=[function(){return{cacheKey:function(b,d,f,k){var e=b.parentNode;b=[e.$$ngAnimateParentKey||(e.$$ngAnimateParentKey=++a),d,b.getAttribute("class")];f&&b.push(f);k&&b.push(k);return b.join(" ")},containsCachedAnimationWithoutDuration:function(a){return(a=b[a])&&!a.isValid||!1},flush:function(){b=Object.create(null)},count:function(a){return(a=b[a])?a.total:0},get:function(a){return(a=b[a])&&a.value},put:function(a,d,f){b[a]?(b[a].total++,b[a].value=d):b[a]={total:1,value:d,isValid:f}}}}]}).provider("$$animation",
|
||||||
|
["$animateProvider",function(a){var b=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$Map","$$rAFScheduler","$$animateCache",function(a,d,f,k,e,Q,L){function x(a){function b(a){if(a.processed)return a;a.processed=!0;var d=a.domNode,t=d.parentNode;f.set(d,a);for(var h;t;){if(h=f.get(t)){h.processed||(h=b(h));break}t=t.parentNode}(h||c).children.push(a);return a}var c={children:[]},d,f=new e;for(d=0;d<a.length;d++){var da=a[d];f.set(da.domNode,a[d]={domNode:da.domNode,
|
||||||
|
element:da.element,fn:da.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var t=0,f=[];for(d=0;d<c.length;d++){var g=c[d];0>=a&&(a=t,t=0,b.push(f),f=[]);f.push(g);g.children.forEach(function(a){t++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var C=[],U=aa(a);return function(e,H,u){function t(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];s(a,function(a){var c=
|
||||||
|
a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function I(a){var b=[],c={};s(a,function(a,d){var l=K(a.element),g=0<=["enter","move"].indexOf(a.event),l=a.structural?t(l):[];if(l.length){var f=g?"to":"from";s(l,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][f]={animationID:d,element:A(a)}})}else b.push(a)});var d={},g={};s(c,function(c,t){var f=c.from,e=c.to;if(f&&e){var h=a[f.animationID],k=a[e.animationID],E=f.animationID.toString();if(!g[E]){var I=g[E]=
|
||||||
|
{structural:!0,beforeStart:function(){h.beforeStart();k.beforeStart()},close:function(){h.close();k.close()},classes:da(h.classes,k.classes),from:h,to:k,anchors:[]};I.classes.length?b.push(I):(b.push(h),b.push(k))}g[E].anchors.push({out:f.element,"in":e.element})}else f=f?f.animationID:e.animationID,e=f.toString(),d[e]||(d[e]=!0,b.push(a[f]))});return b}function da(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var g=a[d];if("ng-"!==g.substring(0,3))for(var t=0;t<b.length;t++)if(g===
|
||||||
|
b[t]){c.push(g);break}}return c.join(" ")}function ia(a){for(var c=b.length-1;0<=c;c--){var d=f.get(b[c])(a);if(d)return d}}function v(a,b){function c(a){(a=a.data("$$animationRunner"))&&a.setHost(b)}a.from&&a.to?(c(a.from.element),c(a.to.element)):c(a.element)}function ua(){var a=e.data("$$animationRunner");!a||"leave"===H&&u.$$domOperationFired||a.end()}function h(b){e.off("$destroy",ua);e.removeData("$$animationRunner");U(e,u);ha(e,u);u.domOperation();E&&a.removeClass(e,E);F.complete(!b)}u=pa(u);
|
||||||
|
var q=0<=["enter","move","leave"].indexOf(H),F=new k({end:function(){h()},cancel:function(){h(!0)}});if(!b.length)return h(),F;var g=Ga(e.attr("class"),Ga(u.addClass,u.removeClass)),E=u.tempClasses;E&&(g+=" "+E,u.tempClasses=null);q&&e.data("$$animatePrepareClasses","ng-"+H+"-prepare");e.data("$$animationRunner",F);C.push({element:e,classes:g,event:H,structural:q,options:u,beforeStart:function(){E=(E?E+" ":"")+"ng-animate";a.addClass(e,E);var b=e.data("$$animatePrepareClasses");b&&a.removeClass(e,
|
||||||
|
b)},close:h});e.on("$destroy",ua);if(1<C.length)return F;d.$$postDigest(function(){var b=[];s(C,function(a){a.element.data("$$animationRunner")?b.push(a):a.close()});C.length=0;var d=I(b),g=[];s(d,function(a){var b=a.from?a.from.element:a.element,c=u.addClass,d=L.cacheKey(b[0],a.event,(c?c+" ":"")+"ng-animate",u.removeClass);g.push({element:b,domNode:K(b),fn:function(){var b,c=a.close;if(L.containsCachedAnimationWithoutDuration(d))c();else{a.beforeStart();if((a.anchors?a.from.element||a.to.element:
|
||||||
|
a.element).data("$$animationRunner")){var g=ia(a);g&&(b=g.start)}b?(b=b(),b.done(function(a){c(!a)}),v(a,b)):c()}}})});for(var d=x(g),t=0;t<d.length;t++)for(var f=d[t],e=0;e<f.length;e++){var h=f[e],k=h.element;d[t][e]=h.fn;0===t?k.removeData("$$animatePrepareClasses"):(h=k.data("$$animatePrepareClasses"))&&a.addClass(k,h)}Q(d)});return F}}]}]).provider("$animateCss",["$animateProvider",function(a){this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$animateCache","$$forceReflow","$sniffer",
|
||||||
|
"$$rAFScheduler","$$animateQueue",function(a,c,d,f,k,e,Q,L,x){function C(d,f,e,x){var v,s="stagger-"+e;0<k.count(e)&&(v=k.get(s),v||(f=$(f,"-stagger"),c.addClass(d,f),v=Ka(a,d,x),v.animationDuration=Math.max(v.animationDuration,0),v.transitionDuration=Math.max(v.transitionDuration,0),c.removeClass(d,f),k.put(s,v,!0)));return v||{}}function U(a){u.push(a);L.waitUntilQuiet(function(){k.flush();for(var a=e(),b=0;b<u.length;b++)u[b](a);u.length=0})}function z(c,d,f,e){d=k.get(f);d||(d=Ka(a,c,Wa),"infinite"===
|
||||||
|
d.animationIterationCount&&(d.animationIterationCount=1));k.put(f,d,e||0<d.transitionDuration||0<d.animationDuration);c=d;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var H=aa(c),u=[];return function(a,b){function e(){v()}function L(){v(!0)}function v(b){if(!(P||la&&m)){P=!0;m=!1;V&&!g.$$skipPreparationClasses&&c.removeClass(a,V);ba&&c.removeClass(a,ba);xa(l,!1);qa(l,!1);
|
||||||
|
s(y,function(a){l.style[a[0]]=""});H(a,g);ha(a,g);Object.keys(E).length&&s(E,function(a,b){a?l.style.setProperty(b,a):l.style.removeProperty(b)});if(g.onDone)g.onDone();w&&w.length&&a.off(w.join(" "),q);var d=a.data("$$animateCss");d&&(f.cancel(d[0].timer),a.removeData("$$animateCss"));fa&&fa.complete(!b)}}function u(a){p.blockTransition&&qa(l,a);p.blockKeyframeAnimation&&xa(l,!!a)}function h(){fa=new d({end:e,cancel:L});U(N);v();return{$$willAnimate:!1,start:function(){return fa},end:e}}function q(a){a.stopPropagation();
|
||||||
|
var b=a.originalEvent||a;b.target===l&&(a=b.$manualTimeStamp||Date.now(),b=parseFloat(b.elapsedTime.toFixed(3)),Math.max(a-J,0)>=G&&b>=D&&(la=!0,v()))}function F(){function b(){if(!P){u(!1);s(y,function(a){l.style[a[0]]=a[1]});H(a,g);c.addClass(a,ba);if(p.recalculateTimingStyles){T=l.getAttribute("class")+" "+V;ka=k.cacheKey(l,ja,g.addClass,g.removeClass);r=z(l,T,ka,!1);ga=r.maxDelay;W=Math.max(ga,0);D=r.maxDuration;if(0===D){v();return}p.hasTransitions=0<r.transitionDuration;p.hasAnimations=0<r.animationDuration}p.applyAnimationDelay&&
|
||||||
|
(ga="boolean"!==typeof g.delay&&ya(g.delay)?parseFloat(g.delay):ga,W=Math.max(ga,0),r.animationDelay=ga,ea=[ra,ga+"s"],y.push(ea),l.style[ea[0]]=ea[1]);G=1E3*W;R=1E3*D;if(g.easing){var e,h=g.easing;p.hasTransitions&&(e=M+"TimingFunction",y.push([e,h]),l.style[e]=h);p.hasAnimations&&(e=ca+"TimingFunction",y.push([e,h]),l.style[e]=h)}r.transitionDuration&&w.push(Aa);r.animationDuration&&w.push(Ba);J=Date.now();var m=G+1.5*R;e=J+m;var h=a.data("$$animateCss")||[],F=!0;if(h.length){var n=h[0];(F=e>n.expectedEndTime)?
|
||||||
|
f.cancel(n.timer):h.push(v)}F&&(m=f(d,m,!1),h[0]={timer:m,expectedEndTime:e},h.push(v),a.data("$$animateCss",h));if(w.length)a.on(w.join(" "),q);g.to&&(g.cleanupStyles&&Ma(E,l,Object.keys(g.to)),Ja(a,g))}}function d(){var b=a.data("$$animateCss");if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData("$$animateCss")}}if(!P)if(l.parentNode){var e=function(a){if(la)m&&a&&(m=!1,v());else if(m=!a,r.animationDuration)if(a=xa(l,m),m)y.push(a);else{var b=y,c=b.indexOf(a);0<=a&&b.splice(c,1)}},h=0<aa&&(r.transitionDuration&&
|
||||||
|
0===X.transitionDuration||r.animationDuration&&0===X.animationDuration)&&Math.max(X.animationDelay,X.transitionDelay);h?f(b,Math.floor(h*aa*1E3),!1):b();A.resume=function(){e(!0)};A.pause=function(){e(!1)}}else v()}var g=b||{};g.$$prepared||(g=pa(Da(g)));var E={},l=K(a);if(!l||!l.parentNode||!x.enabled())return h();var y=[],O=a.attr("class"),B=Qa(g),P,m,la,fa,A,W,G,D,R,J,w=[];if(0===g.duration||!Q.animations&&!Q.transitions)return h();var ja=g.event&&Z(g.event)?g.event.join(" "):g.event,Y=ja&&g.structural,
|
||||||
|
n="",S="";Y?n=$(ja,"ng-",!0):ja&&(n=ja);g.addClass&&(S+=$(g.addClass,"-add"));g.removeClass&&(S.length&&(S+=" "),S+=$(g.removeClass,"-remove"));g.applyClassesEarly&&S.length&&H(a,g);var V=[n,S].join(" ").trim(),T=O+" "+V,O=B.to&&0<Object.keys(B.to).length;if(!(0<(g.keyframeStyle||"").length||O||V))return h();var X,ka=k.cacheKey(l,ja,g.addClass,g.removeClass);if(k.containsCachedAnimationWithoutDuration(ka))return V=null,h();0<g.stagger?(B=parseFloat(g.stagger),X={transitionDelay:B,animationDelay:B,
|
||||||
|
transitionDuration:0,animationDuration:0}):X=C(l,V,ka,Xa);g.$$skipPreparationClasses||c.addClass(a,V);g.transitionStyle&&(B=[M,g.transitionStyle],ma(l,B),y.push(B));0<=g.duration&&(B=0<l.style[M].length,B=La(g.duration,B),ma(l,B),y.push(B));g.keyframeStyle&&(B=[ca,g.keyframeStyle],ma(l,B),y.push(B));var aa=X?0<=g.staggerIndex?g.staggerIndex:k.count(ka):0;(n=0===aa)&&!g.skipBlocking&&qa(l,9999);var r=z(l,T,ka,!Y),ga=r.maxDelay;W=Math.max(ga,0);D=r.maxDuration;var p={};p.hasTransitions=0<r.transitionDuration;
|
||||||
|
p.hasAnimations=0<r.animationDuration;p.hasTransitionAll=p.hasTransitions&&"all"===r.transitionProperty;p.applyTransitionDuration=O&&(p.hasTransitions&&!p.hasTransitionAll||p.hasAnimations&&!p.hasTransitions);p.applyAnimationDuration=g.duration&&p.hasAnimations;p.applyTransitionDelay=ya(g.delay)&&(p.applyTransitionDuration||p.hasTransitions);p.applyAnimationDelay=ya(g.delay)&&p.hasAnimations;p.recalculateTimingStyles=0<S.length;if(p.applyTransitionDuration||p.applyAnimationDuration)D=g.duration?parseFloat(g.duration):
|
||||||
|
D,p.applyTransitionDuration&&(p.hasTransitions=!0,r.transitionDuration=D,B=0<l.style[M+"Property"].length,y.push(La(D,B))),p.applyAnimationDuration&&(p.hasAnimations=!0,r.animationDuration=D,y.push([Ca,D+"s"]));if(0===D&&!p.recalculateTimingStyles)return h();var ba=$(V,"-active");if(null!=g.delay){var ea;"boolean"!==typeof g.delay&&(ea=parseFloat(g.delay),W=Math.max(ea,0));p.applyTransitionDelay&&y.push([na,ea+"s"]);p.applyAnimationDelay&&y.push([ra,ea+"s"])}null==g.duration&&0<r.transitionDuration&&
|
||||||
|
(p.recalculateTimingStyles=p.recalculateTimingStyles||n);G=1E3*W;R=1E3*D;g.skipBlocking||(p.blockTransition=0<r.transitionDuration,p.blockKeyframeAnimation=0<r.animationDuration&&0<X.animationDelay&&0===X.animationDuration);g.from&&(g.cleanupStyles&&Ma(E,l,Object.keys(g.from)),Ia(a,g));p.blockTransition||p.blockKeyframeAnimation?u(D):g.skipBlocking||qa(l,!1);return{$$willAnimate:!0,end:e,start:function(){if(!P)return A={end:e,cancel:L,resume:null,pause:null},fa=new d(A),U(F),fa}}}}]}]).provider("$$animateCssDriver",
|
||||||
|
["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,f,k,e,Q){function L(a){return a.replace(/\bng-\S+\b/g,"")}function x(a,b){G(a)&&(a=a.split(" "));G(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function C(c,e,f){function k(a){var b={},c=K(a).getBoundingClientRect();s(["width","height","top","left"],function(a){var d=c[a];
|
||||||
|
switch(a){case "top":d+=H.scrollTop;break;case "left":d+=H.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function v(){var c=L(f.attr("class")||""),d=x(c,q),c=x(q,c),d=a(h,{to:k(f),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function C(){h.remove();e.removeClass("ng-animate-shim");f.removeClass("ng-animate-shim")}var h=A(K(e).cloneNode(!0)),q=L(h.attr("class")||"");e.addClass("ng-animate-shim");f.addClass("ng-animate-shim");h.addClass("ng-anchor");
|
||||||
|
u.append(h);var F;c=function(){var c=a(h,{addClass:"ng-anchor-out",delay:!0,from:k(e)});return c.$$willAnimate?c:null}();if(!c&&(F=v(),!F))return C();var g=c||F;return{start:function(){function a(){c&&c.end()}var b,c=g.start();c.done(function(){c=null;if(!F&&(F=v()))return c=F.start(),c.done(function(){c=null;C();b.complete()}),c;C();b.complete()});return b=new d({end:a,cancel:a})}}}function z(a,b,c,e){var f=oa(a,N),k=oa(b,N),h=[];s(e,function(a){(a=C(c,a.out,a["in"]))&&h.push(a)});if(f||k||0!==h.length)return{start:function(){function a(){s(b,
|
||||||
|
function(a){a.end()})}var b=[];f&&b.push(f.start());k&&b.push(k.start());s(h,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function oa(c){var d=c.element,e=c.options||{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=e.domOperation));e.preparationClasses&&(e.event=ba(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!k.animations&&!k.transitions)return N;var H=
|
||||||
|
Q[0].body;c=K(f);var u=A(c.parentNode&&11===c.parentNode.nodeType||H.contains(c)?c:H);return function(a){return a.from&&a.to?z(a.from,a.to,a.classes,a.anchors):oa(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function f(c){c=Z(c)?c:c.split(" ");for(var d=[],f={},k=0;k<c.length;k++){var s=c[k],z=a.$$registeredAnimations[s];z&&!f[s]&&(d.push(b.get(z)),f[s]=!0)}return d}var k=aa(d);return function(a,b,d,x){function C(){x.domOperation();
|
||||||
|
k(a,x)}function z(a,b,d,f,e){switch(d){case "animate":b=[b,f.from,f.to,e];break;case "setClass":b=[b,t,I,e];break;case "addClass":b=[b,t,e];break;case "removeClass":b=[b,I,e];break;default:b=[b,e]}b.push(f);if(a=a.apply(a,b))if(Ea(a.start)&&(a=a.start()),a instanceof c)a.done(e);else if(Ea(a))return a;return N}function A(a,b,d,e,f){var h=[];s(e,function(e){var l=e[f];l&&h.push(function(){var e,f,h=!1,k=function(a){h||(h=!0,(f||N)(a),e.complete(!a))};e=new c({end:function(){k()},cancel:function(){k(!0)}});
|
||||||
|
f=z(l,a,b,d,function(a){k(!1===a)});return e})});return h}function H(a,b,d,e,f){var h=A(a,b,d,e,f);if(0===h.length){var k,q;"beforeSetClass"===f?(k=A(a,"removeClass",d,e,"beforeRemoveClass"),q=A(a,"addClass",d,e,"beforeAddClass")):"setClass"===f&&(k=A(a,"removeClass",d,e,"removeClass"),q=A(a,"addClass",d,e,"addClass"));k&&(h=h.concat(k));q&&(h=h.concat(q))}if(0!==h.length)return function(a){var b=[];h.length&&s(h,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){s(b,function(b){a?
|
||||||
|
b.cancel():b.end()})}}}var u=!1;3===arguments.length&&ta(d)&&(x=d,d=null);x=pa(x);d||(d=a.attr("class")||"",x.addClass&&(d+=" "+x.addClass),x.removeClass&&(d+=" "+x.removeClass));var t=x.addClass,I=x.removeClass,G=f(d),K,v;if(G.length){var M,h;"leave"===b?(h="leave",M="afterLeave"):(h="before"+b.charAt(0).toUpperCase()+b.substr(1),M=b);"enter"!==b&&"move"!==b&&(K=H(a,b,x,G,h));v=H(a,b,x,G,M)}if(K||v){var q;return{$$willAnimate:!0,end:function(){q?q.end():(u=!0,C(),ha(a,x),q=new c,q.complete(!0));
|
||||||
|
return q},start:function(){function b(c){u=!0;C();ha(a,x);q.complete(c)}if(q)return q;q=new c;var d,f=[];K&&f.push(function(a){d=K(a)});f.length?f.push(function(a){C();a(!0)}):C();v&&f.push(function(a){d=v(a)});q.setHost({end:function(){u||((d||N)(void 0),b(void 0))},cancel:function(){u||((d||N)(!0),b(!0))}});c.chain(f,b);return q}}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,
|
||||||
|
c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),e=d(a.to);if(b||e)return{start:function(){function a(){return function(){s(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());e&&d.push(e.start());c.all(d,function(a){f.complete(a)});var f=new c({end:a(),cancel:a()});return f}}}else return d(a)}}]}])})(window,window.angular);
|
||||||
|
//# sourceMappingURL=angular-animate.min.js.map
|
17
playmaker/playmaker/static/js/angular-route.min.js
vendored
Normal file
17
playmaker/playmaker/static/js/angular-route.min.js
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
AngularJS v1.7.5
|
||||||
|
(c) 2010-2018 Google, Inc. http://angularjs.org
|
||||||
|
License: MIT
|
||||||
|
*/
|
||||||
|
(function(I,b){'use strict';function z(b,h){var d=[],c=b.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(b,c,h,k){b="?"===k||"*?"===k;k="*"===k||"*?"===k;d.push({name:h,optional:b});c=c||"";return(b?"(?:"+c:c+"(?:")+(k?"(.+?)":"([^/]+)")+(b?"?)?":")")}).replace(/([/$*])/g,"\\$1");h.ignoreTrailingSlashes&&(c=c.replace(/\/+$/,"")+"/*");return{keys:d,regexp:new RegExp("^"+c+"(?:[?#]|$)",h.caseInsensitiveMatch?"i":"")}}function A(b){p&&b.get("$route")}function v(u,h,d){return{restrict:"ECA",
|
||||||
|
terminal:!0,priority:400,transclude:"element",link:function(c,f,g,l,k){function q(){r&&(d.cancel(r),r=null);m&&(m.$destroy(),m=null);s&&(r=d.leave(s),r.done(function(b){!1!==b&&(r=null)}),s=null)}function C(){var g=u.current&&u.current.locals;if(b.isDefined(g&&g.$template)){var g=c.$new(),l=u.current;s=k(g,function(g){d.enter(g,null,s||f).done(function(d){!1===d||!b.isDefined(w)||w&&!c.$eval(w)||h()});q()});m=l.scope=g;m.$emit("$viewContentLoaded");m.$eval(p)}else q()}var m,s,r,w=g.autoscroll,p=g.onload||
|
||||||
|
"";c.$on("$routeChangeSuccess",C);C()}}}function x(b,h,d){return{restrict:"ECA",priority:-400,link:function(c,f){var g=d.current,l=g.locals;f.html(l.$template);var k=b(f.contents());if(g.controller){l.$scope=c;var q=h(g.controller,l);g.controllerAs&&(c[g.controllerAs]=q);f.data("$ngControllerController",q);f.children().data("$ngControllerController",q)}c[g.resolveAs||"$resolve"]=l;k(c)}}}var D,E,F,G,y=b.module("ngRoute",[]).info({angularVersion:"1.7.5"}).provider("$route",function(){function u(d,
|
||||||
|
c){return b.extend(Object.create(d),c)}D=b.isArray;E=b.isObject;F=b.isDefined;G=b.noop;var h={};this.when=function(d,c){var f;f=void 0;if(D(c)){f=f||[];for(var g=0,l=c.length;g<l;g++)f[g]=c[g]}else if(E(c))for(g in f=f||{},c)if("$"!==g.charAt(0)||"$"!==g.charAt(1))f[g]=c[g];f=f||c;b.isUndefined(f.reloadOnUrl)&&(f.reloadOnUrl=!0);b.isUndefined(f.reloadOnSearch)&&(f.reloadOnSearch=!0);b.isUndefined(f.caseInsensitiveMatch)&&(f.caseInsensitiveMatch=this.caseInsensitiveMatch);h[d]=b.extend(f,{originalPath:d},
|
||||||
|
d&&z(d,f));d&&(g="/"===d[d.length-1]?d.substr(0,d.length-1):d+"/",h[g]=b.extend({originalPath:d,redirectTo:d},z(g,f)));return this};this.caseInsensitiveMatch=!1;this.otherwise=function(b){"string"===typeof b&&(b={redirectTo:b});this.when(null,b);return this};p=!0;this.eagerInstantiationEnabled=function(b){return F(b)?(p=b,this):p};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","$browser",function(d,c,f,g,l,k,q,p){function m(a){var e=t.current;n=A();(x=
|
||||||
|
!B&&n&&e&&n.$$route===e.$$route&&(!n.reloadOnUrl||!n.reloadOnSearch&&b.equals(n.pathParams,e.pathParams)))||!e&&!n||d.$broadcast("$routeChangeStart",n,e).defaultPrevented&&a&&a.preventDefault()}function s(){var a=t.current,e=n;if(x)a.params=e.params,b.copy(a.params,f),d.$broadcast("$routeUpdate",a);else if(e||a){B=!1;t.current=e;var c=g.resolve(e);p.$$incOutstandingRequestCount("$route");c.then(r).then(w).then(function(g){return g&&c.then(y).then(function(c){e===t.current&&(e&&(e.locals=c,b.copy(e.params,
|
||||||
|
f)),d.$broadcast("$routeChangeSuccess",e,a))})}).catch(function(b){e===t.current&&d.$broadcast("$routeChangeError",e,a,b)}).finally(function(){p.$$completeOutstandingRequest(G,"$route")})}}function r(a){var e={route:a,hasRedirection:!1};if(a)if(a.redirectTo)if(b.isString(a.redirectTo))e.path=v(a.redirectTo,a.params),e.search=a.params,e.hasRedirection=!0;else{var d=c.path(),f=c.search();a=a.redirectTo(a.pathParams,d,f);b.isDefined(a)&&(e.url=a,e.hasRedirection=!0)}else if(a.resolveRedirectTo)return g.resolve(l.invoke(a.resolveRedirectTo)).then(function(a){b.isDefined(a)&&
|
||||||
|
(e.url=a,e.hasRedirection=!0);return e});return e}function w(a){var b=!0;if(a.route!==t.current)b=!1;else if(a.hasRedirection){var g=c.url(),d=a.url;d?c.url(d).replace():d=c.path(a.path).search(a.search).replace().url();d!==g&&(b=!1)}return b}function y(a){if(a){var e=b.extend({},a.resolve);b.forEach(e,function(a,c){e[c]=b.isString(a)?l.get(a):l.invoke(a,null,null,c)});a=z(a);b.isDefined(a)&&(e.$template=a);return g.all(e)}}function z(a){var e,c;b.isDefined(e=a.template)?b.isFunction(e)&&(e=e(a.params)):
|
||||||
|
b.isDefined(c=a.templateUrl)&&(b.isFunction(c)&&(c=c(a.params)),b.isDefined(c)&&(a.loadedTemplateUrl=q.valueOf(c),e=k(c)));return e}function A(){var a,e;b.forEach(h,function(d,g){var f;if(f=!e){var h=c.path();f=d.keys;var l={};if(d.regexp)if(h=d.regexp.exec(h)){for(var k=1,p=h.length;k<p;++k){var m=f[k-1],n=h[k];m&&n&&(l[m.name]=n)}f=l}else f=null;else f=null;f=a=f}f&&(e=u(d,{params:b.extend({},c.search(),a),pathParams:a}),e.$$route=d)});return e||h[null]&&u(h[null],{params:{},pathParams:{}})}function v(a,
|
||||||
|
c){var d=[];b.forEach((a||"").split(":"),function(a,b){if(0===b)d.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];d.push(c[g]);d.push(f[2]||"");delete c[g]}});return d.join("")}var B=!1,n,x,t={routes:h,reload:function(){B=!0;var a={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;B=!1}};d.$evalAsync(function(){m(a);a.defaultPrevented||s()})},updateParams:function(a){if(this.current&&this.current.$$route)a=b.extend({},this.current.params,a),c.path(v(this.current.$$route.originalPath,
|
||||||
|
a)),c.search(a);else throw H("norout");}};d.$on("$locationChangeStart",m);d.$on("$locationChangeSuccess",s);return t}]}).run(A),H=b.$$minErr("ngRoute"),p;A.$inject=["$injector"];y.provider("$routeParams",function(){this.$get=function(){return{}}});y.directive("ngView",v);y.directive("ngView",x);v.$inject=["$route","$anchorScroll","$animate"];x.$inject=["$compile","$controller","$route"]})(window,window.angular);
|
||||||
|
//# sourceMappingURL=angular-route.min.js.map
|
10
playmaker/playmaker/static/js/angular-touch.min.js
vendored
Normal file
10
playmaker/playmaker/static/js/angular-touch.min.js
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
AngularJS v1.7.5
|
||||||
|
(c) 2010-2018 Google, Inc. http://angularjs.org
|
||||||
|
License: MIT
|
||||||
|
*/
|
||||||
|
(function(t,p){'use strict';function q(g,h,s){n.directive(g,["$parse","$swipe",function(a,b){return function(c,e,f){function k(a){if(!d)return!1;var b=Math.abs(a.y-d.y);a=(a.x-d.x)*h;return l&&75>b&&0<a&&30<a&&.3>b/a}var m=a(f[g]),d,l,r=["touch"];p.isDefined(f.ngSwipeDisableMouse)||r.push("mouse");b.bind(e,{start:function(a,b){d=a;l=!0},cancel:function(a){l=!1},end:function(a,b){k(a)&&c.$apply(function(){e.triggerHandler(s);m(c,{$event:b})})}},r)}}])}var n=p.module("ngTouch",[]);n.info({angularVersion:"1.7.5"});
|
||||||
|
n.factory("$swipe",[function(){function g(a){a=a.originalEvent||a;var b=a.touches&&a.touches.length?a.touches:[a];a=a.changedTouches&&a.changedTouches[0]||b[0];return{x:a.clientX,y:a.clientY}}function h(a,b){var c=[];p.forEach(a,function(a){(a=n[a][b])&&c.push(a)});return c.join(" ")}var n={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup",cancel:"pointercancel"}};
|
||||||
|
return{bind:function(a,b,c){var e,f,k,m,d=!1;c=c||["mouse","touch","pointer"];a.on(h(c,"start"),function(a){k=g(a);d=!0;f=e=0;m=k;b.start&&b.start(k,a)});var l=h(c,"cancel");if(l)a.on(l,function(a){d=!1;b.cancel&&b.cancel(a)});a.on(h(c,"move"),function(a){if(d&&k){var c=g(a);e+=Math.abs(c.x-m.x);f+=Math.abs(c.y-m.y);m=c;10>e&&10>f||(f>e?(d=!1,b.cancel&&b.cancel(a)):(a.preventDefault(),b.move&&b.move(c,a)))}});a.on(h(c,"end"),function(a){d&&(d=!1,b.end&&b.end(g(a),a))})}}}]);q("ngSwipeLeft",-1,"swipeleft");
|
||||||
|
q("ngSwipeRight",1,"swiperight")})(window,window.angular);
|
||||||
|
//# sourceMappingURL=angular-touch.min.js.map
|
5988
playmaker/playmaker/static/js/crypto-js.js
Normal file
5988
playmaker/playmaker/static/js/crypto-js.js
Normal file
File diff suppressed because it is too large
Load Diff
10
playmaker/playmaker/static/js/ui-bootstrap.min.js
vendored
Normal file
10
playmaker/playmaker/static/js/ui-bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
61
playmaker/playmaker/views/app.html
Normal file
61
playmaker/playmaker/views/app.html
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<div>
|
||||||
|
<div class="sidebar">
|
||||||
|
<div class="sidebar-list">
|
||||||
|
<div class="sidebar-list-el">
|
||||||
|
Update applications <a ng-click="$ctrl.check()" class=
|
||||||
|
"btn btn-default sidebar-button">
|
||||||
|
<i class="fas fa-sync-alt" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="sidebar-list-el">
|
||||||
|
Update fdroid repo <a ng-click="$ctrl.fdroid()" class=
|
||||||
|
"btn btn-default">
|
||||||
|
<i class="fab fa-android" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="sidebar-list-el">
|
||||||
|
URL: <code>{{$ctrl.baseUrl}}/fdroid</code>
|
||||||
|
</div>
|
||||||
|
<div class="sidebar-list-el">
|
||||||
|
<strong>Last update:</strong> {{$ctrl.lastFdroidUpdate}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="app-container">
|
||||||
|
<div ng-repeat="app in $ctrl.apps" class="col-xs-12 col-md-12 col-lg-6">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body">
|
||||||
|
<img ng-if="$ctrl.desktop" width="100" height="100" ng-src=
|
||||||
|
"{{app.previewImage[0].imageUrl}}">
|
||||||
|
<div class="apk-info">
|
||||||
|
<strong><span class=
|
||||||
|
"apk-item-title">{{app.title}}</span></strong>
|
||||||
|
<i ng-repeat="val in app.starList" ng-class=
|
||||||
|
"val.full ? 'fas fa-star' : 'far fa-star'"
|
||||||
|
aria-hidden="true"></i>
|
||||||
|
<strong>{{app.formattedStars}}</strong><br>
|
||||||
|
<span><strong>Developer:</strong> {{app.creator}}</span><br>
|
||||||
|
<span><strong>Version:</strong> {{app.details.appDetails.versionCode}}</span><br>
|
||||||
|
<span><strong>Files:</strong> {{app.details.appDetails.file.length}}</span><br>
|
||||||
|
<span ng-if="app.formattedSize !== undefined"><strong>Size:</strong> {{app.formattedSize}} MB</span>
|
||||||
|
<span ng-if="app.formattedSize === undefined"><strong>Size:</strong> unknown</span><br>
|
||||||
|
<span><strong>PackageId:</strong> {{app.docid}}</span><br>
|
||||||
|
</div>
|
||||||
|
</div><!-- panel-body -->
|
||||||
|
<div ng-hide="!app.updating" class="apk-progress">
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar progress-bar-striped active" role=
|
||||||
|
"progressbar" aria-valuenow="100" aria-valuemin="0"
|
||||||
|
aria-valuemax="100" style="width:100%">
|
||||||
|
<span class="sr-only">Updating</span>
|
||||||
|
</div><!-- progress-bar -->
|
||||||
|
</div><!-- progress -->
|
||||||
|
</div><!-- apk-progress -->
|
||||||
|
<div ng-hide="app.updating" class="apk-buttons">
|
||||||
|
<a ng-click="$ctrl.delete(app)" class=
|
||||||
|
"btn btn-raised btn-danger"> delete</a>
|
||||||
|
</div>
|
||||||
|
</div><!-- panel -->
|
||||||
|
</div><!-- main -->
|
||||||
|
</div>
|
||||||
|
</div>
|
42
playmaker/playmaker/views/login.html
Normal file
42
playmaker/playmaker/views/login.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<div class="view-container">
|
||||||
|
<form>
|
||||||
|
<div class="login-body">
|
||||||
|
<h2>First time initialization</h2>
|
||||||
|
<p>In order to initalize the server, you need to enter your google
|
||||||
|
credentials. They are sent to the server, which will perform the login
|
||||||
|
procedure and fetch an authorization token, and then they are
|
||||||
|
discarded. To secure communucation between client and server you should
|
||||||
|
configure playmaker with https, like explained <a href=
|
||||||
|
"https://github.com/NoMore201/playmaker#usage">here</a></p>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="emailInput">Email address</label> <input type="text"
|
||||||
|
class="form-control" id="emailInput" placeholder="Email" ng-model=
|
||||||
|
"user.email" uib-tooltip=
|
||||||
|
"Enter a valid username (with or without '@gmail.com')"
|
||||||
|
tooltip-enable="$ctrl.badUsername" tooltip-placement="top"
|
||||||
|
tooltip-is-open="$ctrl.badUsername" ng-disabled="$ctrl.loggingIn">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="passwordInput">Password</label> <input type="password"
|
||||||
|
class="form-control" id="passwordInput" placeholder="Password"
|
||||||
|
ng-model="user.password" uib-tooltip="Enter a valid password"
|
||||||
|
tooltip-enable="$ctrl.badPassword" tooltip-placement="bottom"
|
||||||
|
tooltip-is-open="$ctrl.badPassword" ng-disabled="$ctrl.loggingIn">
|
||||||
|
</div><button type="submit" class="btn btn-default" ng-click=
|
||||||
|
"$ctrl.login(user)" ng-disabled="$ctrl.loggingIn">Submit</button>
|
||||||
|
<a class="btn btn-warning"
|
||||||
|
href="https://accounts.google.com/b/0/DisplayUnlockCaptcha"
|
||||||
|
target="_blank"
|
||||||
|
ng-disabled="!$ctrl.securityCheck">Security check</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div ng-hide="!$ctrl.loggingIn" class="row loading-login">
|
||||||
|
<div class="loading-login-text">
|
||||||
|
Loading apps into cache, please wait
|
||||||
|
</div>
|
||||||
|
<uib-progressbar class="progress-striped active" max="$ctrl.max" value=
|
||||||
|
"$ctrl.current"><span style=
|
||||||
|
"color:white; white-space:nowrap;">{{$ctrl.formattedPercent}}%</span>
|
||||||
|
</uib-progressbar>
|
||||||
|
</div>
|
||||||
|
</div>
|
101
playmaker/playmaker/views/search.html
Normal file
101
playmaker/playmaker/views/search.html
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<div class="view-container">
|
||||||
|
<div id="search-area" class="input-group input-group-lg">
|
||||||
|
<span class="input-group-addon" id="search-input-label">
|
||||||
|
<i class="fas fa-search"></i>
|
||||||
|
</span>
|
||||||
|
<input ng-model="searchString" on-enter="$ctrl.search(searchString)"
|
||||||
|
type="text" class="form-control" id="search-input" placeholder="Search"
|
||||||
|
aria-describedby="search-input-label">
|
||||||
|
</div>
|
||||||
|
<div ng-hide="!$ctrl.searching" id="search-progress" class="progress">
|
||||||
|
<div class="progress-bar progress-bar-striped active" role="progressbar"
|
||||||
|
aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%">
|
||||||
|
<span class="sr-only">Loading results</span>
|
||||||
|
</div>
|
||||||
|
</div><!-- progress -->
|
||||||
|
<div ng-if="$ctrl.desktop" class="row" id="table-box">
|
||||||
|
<table class="table" ng-hide="$ctrl.results.length === 0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Developer</th>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Version</th>
|
||||||
|
<th>Size</th>
|
||||||
|
<th>Stars</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="table-body">
|
||||||
|
<tr ng-repeat="app in $ctrl.results">
|
||||||
|
<td id="dl-button-td">
|
||||||
|
<a ng-click="$ctrl.download(app)" ng-class=
|
||||||
|
"{'dl-button-disabled': app.disabled, 'dl-button': !app.disabled}">
|
||||||
|
<div ng-hide="app.downloading" class="fa-2x">
|
||||||
|
<i class="fas fa-download"></i>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="!app.downloading" class="fa-2x">
|
||||||
|
<i class="fas fa-cog fa-spin"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>{{app.title}}</td>
|
||||||
|
<td>{{app.creator}}</td>
|
||||||
|
<td>{{app.docid}}</td>
|
||||||
|
<td>{{app.details.appDetails.versionCode}}</td>
|
||||||
|
<td>{{ ((app.details.appDetails.file[0].size)/(1024*1024)).toFixed(2) }} MB</td>
|
||||||
|
<td>{{app.aggregateRating.starRating.toFixed(2)}} Stars</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div ng-if="$ctrl.mobile" class="row" id="table-box">
|
||||||
|
<script type="text/ng-template" id="myModalContent.html">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title" id="modal-title">{{app.title}}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="modal-body">
|
||||||
|
<strong>Id:</strong> {{app.docid}}<br>
|
||||||
|
<strong>Developer:</strong> {{app.creator}}<br>
|
||||||
|
<strong>Version:</strong> {{app.details.appDetails.versionCode}}<br>
|
||||||
|
<strong>Size:</strong> {{ ((app.details.appDetails.file[0].size)/(1024*1024)).toFixed(2) }} MB<br>
|
||||||
|
<strong>Stars:</strong> {{app.aggregateRating.starRating.toFixed(2)}}
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn btn-default" type="button" ng-click="$close()">Close</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<table class="table" ng-hide="$ctrl.results.length === 0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Info</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="table-body">
|
||||||
|
<tr ng-repeat="app in $ctrl.results">
|
||||||
|
<td id="dl-button-td">
|
||||||
|
<a ng-click="$ctrl.download(app)" ng-class=
|
||||||
|
"{'dl-button-disabled': app.disabled, 'dl-button': !app.disabled}">
|
||||||
|
<div ng-hide="app.downloading" class="fa-2x">
|
||||||
|
<i class="fas fa-download"></i>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="!app.downloading" class="fa-2x">
|
||||||
|
<i class="fas fa-cog fa-spin"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>{{app.title}}</td>
|
||||||
|
<td>
|
||||||
|
<a ng-click="$ctrl.modalOpen(app)" class="dl-button">
|
||||||
|
<i class="fas fa-info-circle fa-2x" data-toggle="popover"
|
||||||
|
data-html="true" title="" data-placement="left"
|
||||||
|
data-content="" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div><!-- row -->
|
||||||
|
</div><!-- container -->
|
70
playmaker/pm-server
Normal file
70
playmaker/pm-server
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
from tornado import httpserver
|
||||||
|
from tornado import ioloop as io
|
||||||
|
import functools
|
||||||
|
import tornado_crontab
|
||||||
|
import os
|
||||||
|
import configparser
|
||||||
|
|
||||||
|
from playmaker.server import createServer
|
||||||
|
from playmaker.service import Play
|
||||||
|
|
||||||
|
|
||||||
|
def auto_update(service):
|
||||||
|
if service.loggedIn:
|
||||||
|
print('Executing auto update cron task')
|
||||||
|
apps = service.check_local_apks().get('message')
|
||||||
|
if len(apps) > 0:
|
||||||
|
service.download_selection(apps)
|
||||||
|
service.fdroid_update()
|
||||||
|
|
||||||
|
|
||||||
|
# tornado setup
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# arguments parsing
|
||||||
|
ap = argparse.ArgumentParser(description='Apk and fdroid repository ' +
|
||||||
|
'manager with a web interface.')
|
||||||
|
ap.add_argument('-f', '--fdroid', dest='fdroid',
|
||||||
|
action='store_true', default=False,
|
||||||
|
help='Enable fdroid integration')
|
||||||
|
ap.add_argument('-d', '--debug', dest='debug',
|
||||||
|
action='store_true', default=False,
|
||||||
|
help='Enable debug output')
|
||||||
|
args = ap.parse_args()
|
||||||
|
service = Play(debug=args.debug, fdroid=args.fdroid)
|
||||||
|
app = createServer(service)
|
||||||
|
|
||||||
|
# server setup
|
||||||
|
certfile = os.environ.get('HTTPS_CERTFILE')
|
||||||
|
keyfile = os.environ.get('HTTPS_KEYFILE')
|
||||||
|
server = (httpserver.HTTPServer(app)
|
||||||
|
if certfile is None or keyfile is None else
|
||||||
|
httpserver.HTTPServer(app,
|
||||||
|
ssl_options={'certfile': certfile,
|
||||||
|
'keyfile': keyfile}))
|
||||||
|
server.listen(5000, address='0.0.0.0')
|
||||||
|
|
||||||
|
# credentials setup
|
||||||
|
auth_file_parser = configparser.ConfigParser()
|
||||||
|
auth_file_parser.read('credentials.conf')
|
||||||
|
if 'google' in auth_file_parser:
|
||||||
|
google_section = auth_file_parser['google']
|
||||||
|
if 'email' in google_section and 'password' in google_section:
|
||||||
|
service.set_credentials(google_section['email'], google_section['password'])
|
||||||
|
elif 'gsfId' in google_section and 'token' in google_section:
|
||||||
|
service.set_token_credentials(google_section['gsfId'], google_section['token'])
|
||||||
|
|
||||||
|
if service.has_credentials():
|
||||||
|
service.login()
|
||||||
|
service.update_state()
|
||||||
|
|
||||||
|
# cron task settings
|
||||||
|
cron_string = os.environ.get('CRONTAB_STRING')
|
||||||
|
if cron_string is None:
|
||||||
|
# default is every night at 2AM
|
||||||
|
cron_string = '0 2 * * *'
|
||||||
|
_func = functools.partial(auto_update, *[service])
|
||||||
|
tornado_crontab.CronTabCallback(_func, cron_string).start()
|
||||||
|
io.IOLoop.instance().start()
|
29
playmaker/setup.py
Normal file
29
playmaker/setup.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(name='playmaker',
|
||||||
|
version='0.6.4',
|
||||||
|
description='Apk manager with web interface based on googleplay-api',
|
||||||
|
url='https://github.com/NoMore201/playmaker',
|
||||||
|
author='NoMore201',
|
||||||
|
author_email='domenico.iezzi.201@gmail.com',
|
||||||
|
license='MIT',
|
||||||
|
packages=['playmaker'],
|
||||||
|
package_data={
|
||||||
|
'playmaker': [
|
||||||
|
'index.html',
|
||||||
|
'static/*',
|
||||||
|
'static/css/*',
|
||||||
|
'static/fonts/*',
|
||||||
|
'static/js/*',
|
||||||
|
'views/*'
|
||||||
|
],
|
||||||
|
},
|
||||||
|
install_requires=[
|
||||||
|
'pyaxmlparser',
|
||||||
|
'pycryptodome',
|
||||||
|
'tornado<5',
|
||||||
|
'gpapi>=0.4.4',
|
||||||
|
'tornado-crontab'
|
||||||
|
],
|
||||||
|
scripts=['pm-server']
|
||||||
|
)
|
20
postfix/Dockerfile
Normal file
20
postfix/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM centos:8
|
||||||
|
|
||||||
|
RUN useradd -m -s /bin/false vmail
|
||||||
|
|
||||||
|
RUN dnf install -y epel-release && dnf update -y \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm \
|
||||||
|
&& dnf install -y --enablerepo=gf-plus postfix3-3.5.8 postfix3-ldap-3.5.8 postfix3-mysql-3.5.8 postfix3-pgsql-3.5.8 \
|
||||||
|
&& dnf install -y dovecot-2.3.8 dovecot-pigeonhole-2.3.8 opendkim-2.11.0 opendmarc-1.3.2 \
|
||||||
|
&& dnf install -y cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
#RUN postconf -e inet_interfaces=all
|
||||||
|
|
||||||
|
EXPOSE 25 465 587
|
||||||
|
|
||||||
|
CMD ["postfix", "start-fg"]
|
13
postfix/Makefile
Normal file
13
postfix/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=3.5.8
|
||||||
|
IMAGE=postfix
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
4
pwgen/Dockerfile
Normal file
4
pwgen/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.12
|
||||||
|
|
||||||
|
RUN apk add --no-cache openldap-passwd-pbkdf2 apache2-utils pwgen opendkim-utils coreutils
|
||||||
|
COPY dkim-key.sh /dkim-key.sh
|
13
pwgen/Makefile
Normal file
13
pwgen/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=latest
|
||||||
|
IMAGE=pwgen
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
8
pwgen/dkim-key.sh
Normal file
8
pwgen/dkim-key.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
/usr/bin/opendkim-genkey -d $1 2>/dev/null
|
||||||
|
TXT=$(cat default.txt |base64 -w 0)
|
||||||
|
PRIVATE=$(cat default.private |base64 -w 0)
|
||||||
|
echo "dkim:
|
||||||
|
- name: default
|
||||||
|
default.txt: $TXT
|
||||||
|
default.private: $PRIVATE"
|
24
rspamd/Dockerfile
Normal file
24
rspamd/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
FROM centos:8
|
||||||
|
|
||||||
|
RUN useradd -m -s /bin/false vmail
|
||||||
|
|
||||||
|
RUN dnf install -y epel-release && dnf update -y \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm \
|
||||||
|
&& dnf install -y --enablerepo=gf-plus postfix3-3.5.8 postfix3-ldap-3.5.8 postfix3-mysql-3.5.8 postfix3-pgsql-3.5.8 \
|
||||||
|
&& dnf install -y dovecot-2.3.8 dovecot-pigeonhole-2.3.8 opendkim-2.11.0 opendmarc-1.3.2 \
|
||||||
|
&& dnf install -y cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
RUN curl https://rspamd.com/rpm-stable/centos-8/rspamd.repo > /etc/yum.repos.d/rspamd.repo \
|
||||||
|
&& rpm --import https://rspamd.com/rpm/gpg.key \
|
||||||
|
&& dnf install -y rspamd \
|
||||||
|
&& dnf clean all \
|
||||||
|
&& rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
EXPOSE 11332
|
||||||
|
|
||||||
|
CMD ["/usr/bin/rspamd", "-f", "--insecure"]
|
13
rspamd/Makefile
Normal file
13
rspamd/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=2.6
|
||||||
|
IMAGE=rspamd
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
8
tsig/Dockerfile
Normal file
8
tsig/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM centos:7
|
||||||
|
|
||||||
|
RUN yum install -y epel-release \
|
||||||
|
&& yum install -y knot bind \
|
||||||
|
&& yum clean all && rm -rf /var/cache/yum
|
||||||
|
|
||||||
|
COPY tsig-key.sh /tsig-key.sh
|
||||||
|
|
13
tsig/Makefile
Normal file
13
tsig/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
VERSION=latest
|
||||||
|
IMAGE=tsig
|
||||||
|
REGISTRY=registry.0xace.cc
|
||||||
|
|
||||||
|
.PHONY: build push all
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) .
|
||||||
|
|
||||||
|
push:
|
||||||
|
docker push $(REGISTRY)/$(IMAGE):$(VERSION)
|
||||||
|
|
||||||
|
all: build push
|
9
tsig/tsig-key.sh
Normal file
9
tsig/tsig-key.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
NAME=$(dnssec-keygen -a HMAC-SHA512 -b 512 -n HOST $1 2>/dev/null)
|
||||||
|
ENC_NAME=$(echo $NAME|base64 -w 0)
|
||||||
|
KEY=$(cat $NAME.key |base64 -w 0)
|
||||||
|
PRIVATE=$(cat $NAME.private |base64 -w 0)
|
||||||
|
echo "tsig:
|
||||||
|
- name: $ENC_NAME
|
||||||
|
key: $KEY
|
||||||
|
private: $PRIVATE"
|
Loading…
Reference in New Issue
Block a user