Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
23,541 additions
and
1,190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_ENV=test | ||
DATABASE_URL=mysql://root:testpwd@127.0.0.1:3306/twyne_test?serverVersion=5.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
services: | ||
db: | ||
image: ${{ matrix.db }} | ||
env: | ||
MYSQL_DATABASE: twyne_test | ||
MYSQL_ROOT_PASSWORD: testpwd | ||
ports: | ||
- '3306:3306' | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-latest' ] | ||
# All supported PHP versions https://www.php.net/supported-versions.php | ||
php: [ '7.2', '7.3', '7.4' ] | ||
db: [ 'mariadb:10.4', 'mysql:5.7', 'mysql:8.0' ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
name: PHP ${{ matrix.php }} on ${{ matrix.os }} with ${{ matrix.db }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{matrix.php}} | ||
extensions: fileinfo, json, pdo, mbstring | ||
|
||
- name: Install | ||
env: | ||
APP_ENV: test | ||
# The database server version has to be specified in the format: | ||
# ^(?:5\.5\.5-)?(mariadb-)?<major_version>.<minor_version>.<patch_version> | ||
# This differs from what's in the matrix, so we do it manually below. | ||
run: | | ||
export SERVER_VERSION="8.0" | ||
if [ "${{ matrix.db }}" = "mariadb:10.4" ]; then | ||
SERVER_VERSION="mariadb-10.4.0" | ||
elif [ "${{ matrix.db }}" = "mysql:5.7" ]; then | ||
SERVER_VERSION="5.7" | ||
fi | ||
export DATABASE_URL="mysql://root:testpwd@127.0.0.1:3306/twyne_test?serverVersion=$SERVER_VERSION" | ||
echo DATABASE_URL is: $DATABASE_URL | ||
if [ "$SERVER_VERSION" = "8.0" ]; then | ||
sudo mysql --host 127.0.0.1 -uroot -ptestpwd -e "ALTER USER root IDENTIFIED WITH mysql_native_password BY 'testpwd';" | ||
fi | ||
composer install | ||
./bin/console doctrine:migrations:migrate | ||
- name: Test | ||
run: | | ||
composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Twyne | ||
===== | ||
|
||
A web-based journal for writing and photography. | ||
|
||
## Requirements | ||
|
||
* PHP | ||
* MariaDB or MySQL | ||
* Shell access | ||
|
||
## Installation | ||
|
||
1. Clone: `git clone https://github.com/samwilson/twyne` | ||
2. Install: `cd twyne` then `composer install` and `npm install` | ||
3. Build assets: `npm run build` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@import "../../node_modules/normalize.css/normalize.css"; | ||
|
||
@font-color: #283434; | ||
@font-family: serif; | ||
@border-primary: 2px solid #789987; | ||
@border-secondary: 1px solid #def3e6; | ||
|
||
body { color:@font-color; font-family:@font-family } | ||
|
||
a { color:#4e4efa; text-decoration:none } | ||
a:hover { text-decoration:underline; color:#2c2cff } | ||
|
||
article { max-width:66em; margin:auto } | ||
|
||
body { display:flex; flex-direction:column } | ||
body > header { flex:2; text-align:center; border-bottom:@border-primary; padding:0.5rem; background-color:#f1f8f2 } | ||
body > header a { color:@font-color } | ||
body > main { flex:10; padding:1rem } | ||
body > header h1 { color:@font-color; margin:0; font-variant:small-caps; letter-spacing:0.1em } | ||
body > header nav ul { display:flex; list-style-type:none; margin:0; padding:0 } | ||
body > header nav ul li { flex:1 } | ||
body > footer { | ||
flex:1; text-align:right; font-size:smaller; border-top:@border-primary; padding:1rem; | ||
ul { | ||
list-style-type:none; margin:0; padding:0; display:flex; | ||
li { flex:1 } | ||
} | ||
} | ||
|
||
|
||
/* | ||
* Forms | ||
*/ | ||
form { background-color:#efefef; padding:1rem } | ||
form p label { display:block } | ||
form p { display:flex; align-items:center; margin-bottom:0.4rem } | ||
form p .field.size-1 { flex:1 } | ||
form p .field.size-2 { flex:2 } | ||
form p .field.size-4 { flex:4 } | ||
form p .field.size-6 { flex:6 } | ||
form textarea, | ||
form input[type="text"], | ||
form input[type="password"], | ||
form input[type="email"], | ||
form select { width:100%; border:@border-secondary } | ||
form input[type='submit'] { border:3px outset darkgrey; background-color:gray; border-radius:3px; color:white } | ||
|
||
@import "post"; | ||
@import "security"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
h1 { text-align:center } | ||
|
||
.post-list { | ||
width: 66em; | ||
margin: auto; | ||
list-style-type: none; | ||
.post { | ||
border: @border-secondary; | ||
border-width: 1px 1px 0 1px; | ||
header { display:flex; background-color:#f4f6fb; padding:0 1em 0.2em 1em; align-items:baseline } | ||
header h2 { flex:2; margin:0; padding:0; font-size:medium } | ||
header h2 a { color:@font-color } | ||
header time { flex:1; font-size:smaller; text-align:right } | ||
article { padding: 1em; } | ||
footer { | ||
text-align:center; | ||
a { color:gray } | ||
} | ||
} | ||
.post:last-child { | ||
border-bottom: @border-secondary; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
form.login, | ||
form.register { | ||
max-width:20rem; margin:4rem auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import '../css/app.less'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.