Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Dec 20, 2024
1 parent 6aead58 commit 41400f5
Show file tree
Hide file tree
Showing 22 changed files with 563 additions and 290 deletions.
15 changes: 7 additions & 8 deletions .cfconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"adminPassword" : "coldbox",
"adminPassword" : "kutt",
"debuggingEnabled":true,
"debuggingReportExecutionTimes":false,
"disableInternalCFJavaComponents":false,
"inspectTemplate":"always",
"requestTimeout":"0,0,0,90",
"robustExceptionEnabled":true,
"datasources": {
"coolblog": {
"kutt": {
"class":"${DB_CLASS}",
"dbdriver": "MySQL",
"dsn":"jdbc:mysql://{host}:{port}/{database}",
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true",
"dbdriver": "PostgreSQL",
"dsn":"jdbc:postgresql://{host}:{port}/{database}",
"host":"${DB_HOST:127.0.0.1}",
"username": "${DB_USER:root}",
"username": "${DB_USER:postgres}",
"password": "${DB_PASSWORD}",
"database": "coolblog",
"port": "${DB_PORT:3306}",
"database": "${DB_DATABASE:kutt}",
"port": "${DB_PORT:5432}",
"storage":"false",
"bundleName": "${DB_BUNDLENAME}",
"bundleVersion": "${DB_BUNDLEVERSION}",
Expand Down
26 changes: 20 additions & 6 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
LUCEE_EXTENSIONS=671B01B8-B3B3-42B9-AC055A356BED5281;version=42.7.4

## Module settings
TINYURL_ENABLED=true
KUTT_ENDPOINT=http://127.0.0.1:3000
KUTT_THROWONERROR=true
KUTT_AUTHTOKEN=

## Kutt PG database settings
DB_CLASS=org.postgresql.Driver
DB_DRIVER=PostgreSQL
DB_BUNDLEVERSION=42.7.4
DB_BUNDLENAME=org.postgresql.jdbc42
# DB Location
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=mysql
DB_CLASS=com.mysql.cj.jdbc.Driver
DB_BUNDLEVERSION=8.0.19
DB_BUNDLENAME=com.mysql.cj
DB_PORT=5432
DB_CONNECTIONSTRING=jdbc:postgresql://localhost:5432/kutt
# DB Credentials
DB_DATABASE=kutt
DB_USER=
DB_PASSWORD=
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: boolean

env:
MODULE_ID: @MODULE_SLUG@
MODULE_ID: kutt-sdk
SNAPSHOT: ${{ inputs.snapshot || false }}

jobs:
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Tests
runs-on: ubuntu-20.04
env:
DB_USER: root
DB_PASSWORD: root
DB_USER: kutt
DB_PASSWORD: T1nyURLs!
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
Expand All @@ -39,12 +39,6 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

# - name: Setup Database and Fixtures
# run: |
# sudo systemctl start mysql.service
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE mementifier;'
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql

- name: Setup Java
uses: actions/setup-java@v4
with:
Expand All @@ -54,20 +48,24 @@ jobs:
- name: Setup CommandBox CLI
uses: Ortus-Solutions/[email protected]

# Not Needed in this module
#- name: Setup Environment For Testing Process
# run: |
# # Setup .env
# touch .env
# # ENV
# printf "DB_HOST=localhost\n" >> .env
# printf "DB_DATABASE=mydatabase\n" >> .env
# printf "DB_DRIVER=MySQL\n" >> .env
# printf "DB_USER=${{ env.DB_USER }}\n" >> .env
# printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
# printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
# printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
# printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
- name: Setup Environment For Testing Process
run: |
touch .env
printf "LUCEE_EXTENSIONS=671B01B8-B3B3-42B9-AC055A356BED5281;version=42.7.4" >> .env
printf "TINYURL_ENABLED=true" >> .env
printf "KUTT_ENDPOINT=http://127.0.0.1:3000" >> .env
printf "KUTT_THROWONERROR=true" >> .env
printf "KUTT_AUTHTOKEN=" >> .env
printf "DB_CLASS=org.postgresql.Driver" >> .env
printf "DB_DRIVER=PostgreSQL" >> .env
printf "DB_BUNDLEVERSION=42.7.4" >> .env
printf "DB_BUNDLENAME=org.postgresql.jdbc42" >> .env
printf "DB_HOST=127.0.0.1" >> .env
printf "DB_PORT=5432" >> .env
printf "DB_CONNECTIONSTRING=jdbc:postgresql://localhost:5432/kutt" >> .env
printf "DB_DATABASE=kutt" >> .env
printf "DB_USER=${{ env.DB_USER }}\n" >> .env
printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
- name: Install Test Harness with ColdBox ${{ matrix.coldboxVersion }}
run: |
Expand All @@ -76,6 +74,9 @@ jobs:
box package set dependencies.coldbox=${{ matrix.coldboxVersion }}
box install
- name: Start Kutt Stack
uses: hoverkraft-tech/[email protected]

- name: Start ${{ matrix.cfengine }} Server
run: |
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing Guide

Hola amigo! I'm really excited that you are interested in contributing to @MODULE_NAME@. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
Hola amigo! I'm really excited that you are interested in contributing to Kutt SDK. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

- [Code Of Conduct](#code-of-conduct)
- [Bug Reporting](#bug-reporting)
Expand Down Expand Up @@ -98,11 +98,11 @@ You can support ColdBox and all of our Open Source initiatives at Ortus Solution

## Contributors

Thank you to all the people who have already contributed to @MODULE_NAME@! We :heart: :heart: :heart: love you!
Thank you to all the people who have already contributed to Kutt SDK! We :heart: :heart: :heart: love you!


<a href = "https://github.com/coldbox-modules/@module_name@/graphs/contributors">
<img src = "https://contrib.rocks/image?repo=coldbox-modules/@module_name@"/>
<a href = "https://github.com/coldbox-modules/Kutt SDK/graphs/contributors">
<img src = "https://contrib.rocks/image?repo=coldbox-modules/Kutt SDK"/>
</a>

Made with [contributors-img](https://contrib.rocks)
20 changes: 15 additions & 5 deletions ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
component {

// Module Properties
this.title = "@MODULE_NAME@";
this.title = "Kutt SDK";
this.author = "Ortus Solutions";
this.webURL = "https://www.ortussolutions.com";
this.description = "@MODULE_DESCRIPTION@";
this.description = "Tiny URL SDK for kutt.it";
this.version = "@build.version@[email protected]@";

// Model Namespace
this.modelNamespace = "@MODULE_SLUG@";
this.modelNamespace = "Kutt";

// CF Mapping
this.cfmapping = "@MODULE_SLUG@";
this.cfmapping = "Kutt";

// Dependencies
this.dependencies = [];
Expand All @@ -25,9 +25,19 @@ component {
* Configure Module
*/
function configure(){
// module settings - stored in modules.name.settings
settings = {

"enabled" : getSystemSetting( "TINYURL_ENABLED", true ),
"endpoint" : getSystemSetting( "KUTT_ENDPOINT", "" ),
"authToken" : getSystemSetting( "KUTT_AUTHTOKEN", "" ),
"defaultExipration" : "30 days",
"throwOnError" : getSystemSetting( "KUTT_THROWONERROR", false )
};

if( !len( settings.endpoint ) ){
log.error( "The tiny-url module requires an endpoint to be set in the configuration. Module functionality has been deactivated" );
settings.enabled = false;
}
}

/**
Expand Down
88 changes: 48 additions & 40 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,62 @@
{
"name" : "@MODULE_NAME@",
"version" : "1.0.0",
"location" : "https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/@MODULE_SLUG@/@build.version@/@MODULE_SLUG@[email protected]@.zip",
"author" : "Ortus Solutions <[email protected]>",
"homepage" : "https://github.com/coldbox-modules/@MODULE_SLUG@",
"documentation" : "https://github.com/coldbox-modules/@MODULE_SLUG@",
"repository" : { "type" : "git", "url" : "https://github.com/coldbox-modules/@MODULE_SLUG@" },
"bugs" : "https://github.com/coldbox-modules/@MODULE_SLUG@",
"shortDescription" : "Description goes here",
"slug" : "@MODULE_SLUG@",
"type" : "modules",
"keywords":"",
"license" : [
{ "type" : "Apache2", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }
],
"contributors" : [
],
"dependencies" :{
},
"devDependencies" :{
"commandbox-cfformat":"*",
"name":"KuttSDK",
"version":"1.0.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/kutt-sdk/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"homepage":"https://github.com/coldbox-modules/kutt-sdk",
"documentation":"https://github.com/coldbox-modules/kutt-sdk",
"repository":{
"type":"git",
"url":"https://github.com/coldbox-modules/kutt-sdk"
},
"bugs":"https://github.com/coldbox-modules/kutt-sdk",
"shortDescription":"An SKD for creating short URLs with the Kutt API",
"slug":"kutt-sdk",
"type":"modules",
"keywords":"",
"license":[
{
"type":"Apache2",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
],
"contributors":[],
"dependencies":{
"hyper":"^8.0.0"
},
"devDependencies":{
"commandbox-cfformat":"*",
"commandbox-docbox":"*",
"commandbox-dotenv":"*",
"commandbox-dotenv":"*",
"commandbox-cfconfig":"*"
},
"ignore":[
},
"ignore":[
"**/.*",
"test-harness",
"/server*.json"
"/server*.json"
],
"scripts":{
"setupTemplate": "task run taskFile=build/SetupTemplate.cfc",
"build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`",
"build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`",
"scripts":{
"build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`",
"build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`",
"install:dependencies":"install && cd test-harness && install",
"release":"recipe build/release.boxr",
"release":"recipe build/release.boxr",
"format":"cfformat run helpers,models,test-harness/tests/,ModuleConfig.cfc --overwrite",
"format:watch":"cfformat watch helpers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json",
"format:check":"cfformat check helpers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json",
"start:lucee" : "server start [email protected]",
"start:2018" : "server start [email protected]",
"start:2021" : "server start [email protected]",
"stop:lucee" : "server stop [email protected]",
"stop:2018" : "server stop [email protected]",
"stop:2021" : "server stop [email protected]",
"logs:lucee" : "server log [email protected] --follow",
"logs:2018" : "server log [email protected] --follow",
"logs:2021" : "server log [email protected] --follow"
"start:lucee":"server start [email protected]",
"start:2018":"server start [email protected]",
"start:2021":"server start [email protected]",
"stop:lucee":"server stop [email protected]",
"stop:2018":"server stop [email protected]",
"stop:2021":"server stop [email protected]",
"logs:lucee":"server log [email protected] --follow",
"logs:2018":"server log [email protected] --follow",
"logs:2021":"server log [email protected] --follow"
},
"testbox":{
"testbox":{
"runner":"http://localhost:60299/tests/runner.cfm"
},
"installPaths":{
"hyper":"modules/hyper/"
}
}
70 changes: 0 additions & 70 deletions build/SetupTemplate.cfc

This file was deleted.

2 changes: 0 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.0] => 2021-JAN-01

* First iteration of this module
Loading

0 comments on commit 41400f5

Please sign in to comment.