├── CHECKS ├── system.properties ├── src ├── test │ ├── eo │ │ └── com │ │ │ └── threecopies │ │ │ └── entrance-test.eo │ ├── resources │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── log4j.properties │ ├── dynamodb │ │ ├── scripts.json │ │ └── logs.json │ └── java │ │ └── com │ │ └── threecopies │ │ ├── base │ │ ├── package-info.java │ │ └── DyScriptITCase.java │ │ ├── routine │ │ ├── package-info.java │ │ └── RoutineITCase.java │ │ └── tk │ │ ├── package-info.java │ │ └── TkAppTest.java └── main │ ├── resources │ ├── com │ │ └── threecopies │ │ │ ├── routine │ │ │ ├── ssh.key │ │ │ ├── kill.sh │ │ │ ├── finish.sh │ │ │ └── start.sh │ │ │ └── tk │ │ │ └── error.html.vm │ ├── images │ │ ├── logo.png │ │ └── logo.svg │ ├── META-INF │ │ └── MANIFEST.MF │ └── log4j.properties │ ├── eo │ └── com │ │ └── threecopies │ │ └── main.eo │ ├── scss │ └── main.scss │ ├── java │ └── com │ │ └── threecopies │ │ ├── package-info.java │ │ ├── base │ │ ├── package-info.java │ │ ├── FkBase.java │ │ ├── Base.java │ │ ├── FkUser.java │ │ ├── User.java │ │ ├── FkScript.java │ │ ├── DyBase.java │ │ ├── Dynamo.java │ │ ├── Script.java │ │ ├── DyUser.java │ │ └── DyScript.java │ │ ├── routine │ │ ├── package-info.java │ │ └── Routine.java │ │ ├── tk │ │ ├── package-info.java │ │ ├── TkIndex.java │ │ ├── TkDelete.java │ │ ├── TkFlush.java │ │ ├── TkSave.java │ │ ├── TkDeleteLog.java │ │ ├── TkLogLink.java │ │ ├── TkScript.java │ │ ├── TkLogs.java │ │ ├── TkScripts.java │ │ ├── TkPay.java │ │ ├── RqUser.java │ │ ├── TkLog.java │ │ ├── RsPage.java │ │ └── TkApp.java │ │ └── Entrance.java │ └── xsl │ ├── templates.xsl │ ├── script.xsl │ ├── index.xsl │ ├── logs.xsl │ ├── layout.xsl │ └── scripts.xsl ├── .gitignore ├── renovate.json ├── .pdd ├── Procfile ├── deploy.sh ├── .github └── workflows │ ├── xcop.yml │ ├── pdd.yml │ ├── codecov.yml │ └── mvn.yml ├── .gitattributes ├── LICENSE.txt ├── .rultor.yml ├── README.md └── pom.xml /CHECKS: -------------------------------------------------------------------------------- 1 | / millis 2 | -------------------------------------------------------------------------------- /system.properties: -------------------------------------------------------------------------------- 1 | java.runtime.version=1.8 2 | -------------------------------------------------------------------------------- /src/test/eo/com/threecopies/entrance-test.eo: -------------------------------------------------------------------------------- 1 | tbd... 2 | -------------------------------------------------------------------------------- /src/main/resources/com/threecopies/routine/ssh.key: -------------------------------------------------------------------------------- 1 | ${ssh.key} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .idea/ 3 | .DS_Store 4 | .sass-cache/ 5 | *.iml 6 | -------------------------------------------------------------------------------- /src/main/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yegor256/threecopies/HEAD/src/main/resources/images/logo.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.pdd: -------------------------------------------------------------------------------- 1 | --source=. 2 | --verbose 3 | --exclude=src/main/resources/images/**/* 4 | --rule=min-words:20 5 | --rule=min-estimate:15 6 | --rule=max-estimate:90 7 | -------------------------------------------------------------------------------- /src/main/eo/com/threecopies/main.eo: -------------------------------------------------------------------------------- 1 | main: 2 | invoke: 3 | @FtCli: 4 | @TkText: 5 | "Hello, world!" 6 | org.eolang.cli.args 7 | "start" 8 | @Exit.NEVER 9 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: java -Dfile.encoding=UTF-8 -Xmx400m -XX:MaxPermSize=64m -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -cp target/threecopies.jar:target/deps/* com.threecopies.Entrance --port=${PORT} --threads=50 --max-latency=45000 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/com/threecopies/routine/kill.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | container=$1 4 | minutes=$2 5 | 6 | cd "${container}" 7 | docker rm -f "${container}" 8 | echo "The script was killed because it was taking too long (${minutes} minutes)" >> log 9 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0) 5 | cp /code/home/assets/threecopies/settings.xml . 6 | git add settings.xml 7 | git commit -m 'settings.xml for dokku' 8 | trap 'git reset HEAD~1 && rm settings.xml' EXIT 9 | git push dokku master -f 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/com/threecopies/tk/error.html.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Internal application error 5 | 6 | 7 |
${err}
8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/workflows/xcop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: xcop 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | jobs: 11 | xcop: 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: g4s8/xcop-action@master 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Check out all text files in UNIX format, with LF as end of line 2 | # Don't change this file. If you have any ideas about it, please 3 | # submit a separate issue about it and we'll discuss. 4 | 5 | * text=auto eol=lf 6 | *.java ident 7 | *.xml ident 8 | *.png binary 9 | *.jpg binary 10 | *.ico binary 11 | -------------------------------------------------------------------------------- /.github/workflows/pdd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: pdd 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | jobs: 11 | pdd: 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: volodya-lombrozo/pdd-action@master 16 | -------------------------------------------------------------------------------- /src/main/resources/com/threecopies/routine/finish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | container=$1 4 | 5 | if [ -e "${container}" ]; then 6 | cd "${container}" 7 | if [ -e exit ]; then 8 | cat exit 9 | echo "finish:$(date --iso-8601=seconds)" >> log 10 | cat log 11 | cd .. 12 | rm -rf "${container}" 13 | fi 14 | else 15 | echo 1 16 | echo "Internal application error" 17 | echo "${container} directory is absent" 18 | fi 19 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | ThreeCopies-Revision: BUILD 2 | ThreeCopies-Version: ${project.version} 3 | ThreeCopies-Date: ${timestamp} 4 | ThreeCopies-SentryDsn: ${sentry.dsn} 5 | ThreeCopies-DynamoKey: ${dynamo.key} 6 | ThreeCopies-DynamoSecret: ${dynamo.secret} 7 | ThreeCopies-S3Key: ${s3.key} 8 | ThreeCopies-S3Secret: ${s3.secret} 9 | ThreeCopies-GithubId: ${github.id} 10 | ThreeCopies-GithubSecret: ${github.secret} 11 | ThreeCopies-SecurityKey: ${security.key} 12 | ThreeCopies-StripeKey: ${stripe.live.key} 13 | ThreeCopies-StripeSecret: ${stripe.live.secret} 14 | -------------------------------------------------------------------------------- /src/test/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | ThreeCopies-Revision: a1b2c3e 2 | ThreeCopies-Version: 1.0 3 | ThreeCopies-Date: ${timestamp} 4 | ThreeCopies-SentryDsn: test 5 | ThreeCopies-DynamoKey: ${failsafe.dynamo.key} 6 | ThreeCopies-DynamoSecret: ${failsafe.dynamo.secret} 7 | ThreeCopies-S3Key: test 8 | ThreeCopies-S3Secret: test 9 | ThreeCopies-GithubId: ${failsafe.github.id} 10 | ThreeCopies-GithubSecret: ${failsafe.github.secret} 11 | ThreeCopies-SecurityKey: 0000111122223333 12 | ThreeCopies-StripeKey: ${stripe.test.key} 13 | ThreeCopies-StripeSecret: ${stripe.test.secret} 14 | -------------------------------------------------------------------------------- /src/test/dynamodb/scripts.json: -------------------------------------------------------------------------------- 1 | { 2 | "TableName": "scripts", 3 | "AttributeDefinitions": [ 4 | { 5 | "AttributeName": "login", 6 | "AttributeType": "S" 7 | }, 8 | { 9 | "AttributeName": "name", 10 | "AttributeType": "S" 11 | } 12 | ], 13 | "KeySchema": [ 14 | { 15 | "AttributeName": "login", 16 | "KeyType": "HASH" 17 | }, 18 | { 19 | "AttributeName": "name", 20 | "KeyType": "RANGE" 21 | } 22 | ], 23 | "ProvisionedThroughput": { 24 | "ReadCapacityUnits": "1", 25 | "WriteCapacityUnits": "1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/codecov.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: codecov 3 | on: 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | codecov: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-java@v3 13 | with: 14 | distribution: 'temurin' 15 | java-version: 11 16 | - uses: actions/cache@v4 17 | with: 18 | path: ~/.m2/repository 19 | key: maven-${{ hashFiles('**/pom.xml') }} 20 | restore-keys: | 21 | maven- 22 | - run: mvn install -Pjacoco 23 | - uses: codecov/codecov-action@v3 24 | with: 25 | file: ./target/site/jacoco/jacoco.xml 26 | fail_ci_if_error: true 27 | -------------------------------------------------------------------------------- /src/main/resources/com/threecopies/routine/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | container=$1 4 | period=$2 5 | image=yegor256/threecopies 6 | 7 | if docker ps | grep --quiet "\s${container}\s*\$"; then 8 | echo "Docker container ${container} is still running" 9 | exit -1 10 | fi 11 | 12 | cd "$(dirname "$0")" 13 | cd "${container}" 14 | echo "start:$(date --iso-8601=seconds)" > log 15 | chmod a+x script.sh 16 | docker pull "${image}" 17 | docker run -t --rm --name "${container}" \ 18 | -v "$(pwd):/main" \ 19 | --hostname=docker --privileged \ 20 | --memory=6g --memory-swap=16g --oom-kill-disable \ 21 | -e="period=${period}" \ 22 | -w="/root" \ 23 | "${image}" /main/script.sh \ 24 | >> log 2>&1; echo $? > exit 25 | -------------------------------------------------------------------------------- /.github/workflows/mvn.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: mvn 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | jobs: 11 | mvn: 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | matrix: 15 | os: [ubuntu-20.04, windows-2022, macos-12] 16 | java: [11, 17] 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: actions/setup-java@v3 20 | with: 21 | distribution: 'temurin' 22 | java-version: ${{ matrix.java }} 23 | - uses: actions/cache@v4 24 | with: 25 | path: ~/.m2/repository 26 | key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }} 27 | restore-keys: | 28 | ${{ runner.os }}-jdk-${{ matrix.java }}-maven- 29 | - run: java -version 30 | - run: mvn -version 31 | - run: mvn --errors --batch-mode clean install -Pqulice 32 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2023 Yegor Bugayenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: the above copyright notice and this 12 | permission notice shall be included in all copies or substantial 13 | portions of the Software. The software is provided "as is", without 14 | warranty of any kind, express or implied, including but not limited to 15 | the warranties of merchantability, fitness for a particular purpose 16 | and non-infringement. In no event shall the authors or copyright 17 | holders be liable for any claim, damages or other liability, whether 18 | in an action of contract, tort or otherwise, arising from, out of or 19 | in connection with the software or the use or other dealings in the 20 | software. 21 | -------------------------------------------------------------------------------- /.rultor.yml: -------------------------------------------------------------------------------- 1 | docker: 2 | image: yegor256/rultor-image:1.11.0 3 | readers: 4 | - "urn:github:526301" 5 | assets: 6 | settings.xml: yegor256/home#assets/threecopies/settings.xml 7 | id_rsa: yegor256/home#assets/heroku-key 8 | id_rsa.pub: yegor256/home#assets/heroku-key.pub 9 | s3cfg: yegor256/home#assets/s3cfg 10 | install: |- 11 | pdd --source=$(pwd) --verbose --file=/dev/null 12 | release: 13 | pre: false 14 | sensitive: 15 | - settings.xml 16 | script: | 17 | mvn versions:set "-DnewVersion=${tag}" 18 | git commit -am "${tag}" 19 | cp ../settings.xml settings.xml 20 | mvn clean package -Pqulice -Pthreecopies --errors --batch-mode 21 | git remote add dokku dokku@www.threecopies.com:threecopies 22 | mkdir ~/.ssh 23 | mv ../id_rsa ../id_rsa.pub ~/.ssh 24 | chmod -R 600 ~/.ssh/* 25 | echo -e "Host *\n StrictHostKeyChecking no\n UserKnownHostsFile=/dev/null" > ~/.ssh/config 26 | git add settings.xml 27 | git fetch 28 | git commit -m 'settings.xml' 29 | git push -f dokku $(git symbolic-ref --short HEAD):master 30 | git reset HEAD~1 31 | rm -rf settings.xml 32 | curl -f --connect-timeout 15 --retry 5 --retry-delay 30 https://www.threecopies.com > /dev/null 33 | merge: 34 | script: |- 35 | mvn help:system clean install -Pqulice --settings ../settings.xml 36 | -------------------------------------------------------------------------------- /src/main/scss/main.scss: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017-2023 Yegor Bugayenko 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining 6 | // a copy of this software and associated documentation files (the 7 | // "Software"), to deal in the Software without restriction, including 8 | // without limitation the rights to use, copy, modify, merge, publish, 9 | // distribute, sublicense, and/or sell copies of the Software, and to 10 | // permit persons to whom the Software is furnished to do so, subject to 11 | // the following conditions: the above copyright notice and this 12 | // permission notice shall be included in all copies or substantial 13 | // portions of the Software. The software is provided "as is", without 14 | // warranty of any kind, express or implied, including but not limited to 15 | // the warranties of merchantability, fitness for a particular purpose 16 | // and non-infringement. In no event shall the authors or copyright 17 | // holders be liable for any claim, damages or other liability, whether 18 | // in an action of contract, tort or otherwise, arising from, out of or 19 | // in connection with the software or the use or other dealings in the 20 | // software. 21 | 22 | .logo { 23 | height: 75px; 24 | } 25 | 26 | .bottom { 27 | color: gray; 28 | font-size: 0.8em; 29 | } 30 | 31 | .flash-SEVERE { color: red; } 32 | 33 | .flash-INFO { color: green; } 34 | 35 | .flash-WARNING { color: orange; } 36 | -------------------------------------------------------------------------------- /src/main/java/com/threecopies/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: 367235c2d9cda1aa308faae8f550cac5a4962301 $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies; 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/threecopies/base/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies, base. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: d9cfc6f6cad9bc0c61142330686635db7625c69b $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.base; 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/threecopies/routine/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: 95a9a63248417026d5abf6a6d290de177ffde43c $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.routine; 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/threecopies/tk/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies, web front. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: ce5cca0a47767d53d269a702cfd2403c74a9c015 $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.tk; 32 | 33 | -------------------------------------------------------------------------------- /src/test/java/com/threecopies/base/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies, base, tests. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: 39ee12407ad3b664c8ee5c3df69661f88613a647 $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.base; 32 | 33 | -------------------------------------------------------------------------------- /src/test/java/com/threecopies/routine/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies, tests. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: 6b23fcc355b760d04ca5279f1c0745cbe9a37df3 $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.routine; 32 | 33 | -------------------------------------------------------------------------------- /src/test/java/com/threecopies/tk/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | 24 | /** 25 | * ThreeCopies, web front, tests. 26 | * 27 | * @author Yegor Bugayenko (yegor256@gmail.com) 28 | * @version $Id: 96759102b21d33f1e7eaa494d5dfe079f92d0950 $ 29 | * @since 0.1 30 | */ 31 | package com.threecopies.tk; 32 | 33 | -------------------------------------------------------------------------------- /src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2017-2023 Yegor Bugayenko 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: the above copyright notice and this 12 | # permission notice shall be included in all copies or substantial 13 | # portions of the Software. The software is provided "as is", without 14 | # warranty of any kind, express or implied, including but not limited to 15 | # the warranties of merchantability, fitness for a particular purpose 16 | # and non-infringement. In no event shall the authors or copyright 17 | # holders be liable for any claim, damages or other liability, whether 18 | # in an action of contract, tort or otherwise, arising from, out of or 19 | # in connection with the software or the use or other dealings in the 20 | # software. 21 | 22 | log4j.rootLogger=WARN, CONSOLE 23 | 24 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 25 | log4j.appender.CONSOLE.layout=com.jcabi.log.MulticolorLayout 26 | log4j.appender.CONSOLE.layout.ConversionPattern=[%color{%p}] %c: %m%n 27 | 28 | log4j.logger.com.threecopies=INFO 29 | log4j.logger.com.jcabi.dynamo=WARN 30 | -------------------------------------------------------------------------------- /src/test/dynamodb/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "TableName": "logs", 3 | "AttributeDefinitions": [ 4 | { 5 | "AttributeName": "group", 6 | "AttributeType": "S" 7 | }, 8 | { 9 | "AttributeName": "start", 10 | "AttributeType": "N" 11 | }, 12 | { 13 | "AttributeName": "finish", 14 | "AttributeType": "N" 15 | }, 16 | { 17 | "AttributeName": "login", 18 | "AttributeType": "S" 19 | } 20 | ], 21 | "KeySchema": [ 22 | { 23 | "AttributeName": "group", 24 | "KeyType": "HASH" 25 | }, 26 | { 27 | "AttributeName": "start", 28 | "KeyType": "RANGE" 29 | } 30 | ], 31 | "ProvisionedThroughput": { 32 | "ReadCapacityUnits": "1", 33 | "WriteCapacityUnits": "1" 34 | }, 35 | "GlobalSecondaryIndexes": [ 36 | { 37 | "IndexName": "open", 38 | "KeySchema": [ 39 | { 40 | "AttributeName": "group", 41 | "KeyType": "HASH" 42 | }, 43 | { 44 | "AttributeName": "finish", 45 | "KeyType": "RANGE" 46 | } 47 | ], 48 | "Projection": { 49 | "ProjectionType": "ALL" 50 | }, 51 | "ProvisionedThroughput": { 52 | "ReadCapacityUnits": "1", 53 | "WriteCapacityUnits": "1" 54 | } 55 | }, 56 | { 57 | "IndexName": "mine", 58 | "KeySchema": [ 59 | { 60 | "AttributeName": "login", 61 | "KeyType": "HASH" 62 | }, 63 | { 64 | "AttributeName": "finish", 65 | "KeyType": "RANGE" 66 | } 67 | ], 68 | "Projection": { 69 | "ProjectionType": "ALL" 70 | }, 71 | "ProvisionedThroughput": { 72 | "ReadCapacityUnits": "1", 73 | "WriteCapacityUnits": "1" 74 | } 75 | } 76 | ] 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/threecopies/base/FkBase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017-2023 Yegor Bugayenko 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: the above copyright notice and this 13 | * permission notice shall be included in all copies or substantial 14 | * portions of the Software. The software is provided "as is", without 15 | * warranty of any kind, express or implied, including but not limited to 16 | * the warranties of merchantability, fitness for a particular purpose 17 | * and non-infringement. In no event shall the authors or copyright 18 | * holders be liable for any claim, damages or other liability, whether 19 | * in an action of contract, tort or otherwise, arising from, out of or 20 | * in connection with the software or the use or other dealings in the 21 | * software. 22 | */ 23 | package com.threecopies.base; 24 | 25 | import java.util.Collections; 26 | 27 | /** 28 | * Fake base. 29 | * 30 | * @author Yegor Bugayenko (yegor256@gmail.com) 31 | * @version $Id: 6cc2f95e3455e8f9254a0123c5be42af2ee2e099 $ 32 | * @since 1.0 33 | */ 34 | public final class FkBase implements Base { 35 | 36 | @Override 37 | public User user(final String login) { 38 | return new FkUser(); 39 | } 40 | 41 | @Override 42 | public Iterable