Compare commits
12 Commits
44a8a72219
...
v1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| dd83e0de95 | |||
| f3b91ac1d7 | |||
| 205fa5f3a1 | |||
| 5b284cc107 | |||
| 9c682ea58d | |||
| 24a0892160 | |||
| 50f62535e6 | |||
| abd2d93c90 | |||
| 3fdb7d4e09 | |||
| c822de468c | |||
| f1fceff25a | |||
| f6b4aeea83 |
3
.gitmessage
Normal file
3
.gitmessage
Normal file
@@ -0,0 +1,3 @@
|
||||
{type}: {component}
|
||||
|
||||
{summary}
|
||||
@@ -49,7 +49,7 @@ COPY data/data.db /data/data.db
|
||||
|
||||
RUN mkdir /var/www/html/var/cache
|
||||
RUN mkdir /var/www/html/var/log
|
||||
RUN symfony console asset-map:compile
|
||||
#RUN symfony console asset-map:compile
|
||||
|
||||
RUN chown -R 33:33 /var/www/html /data
|
||||
RUN chmod -R 755 /var/www/html /data
|
||||
|
||||
@@ -19,7 +19,7 @@ This was my first publicly available docker container so I did not realize what
|
||||
|
||||
1. Make a directory in your desired docker storage folder (e.g. `~/docker/sermon-notes`), then `cd` into it.
|
||||
2. Create a file called `.env` in that folder, no need to add anything to it right now.
|
||||
3. Run `docker run -d --name sermon-notes -p 80:80 -v $PWD/data:/data -v $PWD/.env:/var/www/html/.env ryanprather/sermon-notes:latest`, this will download and start the container and keep it running in the background. If you already have something on port 80 change the first `80` to whatever open port you'd like.
|
||||
3. Run `docker run -d --name sermon-notes -p 80:80 -v $PWD/data:/data -v $PWD/.env:/var/www/html/.env gitea.rkprather.com/ryan/sermon-notes:latest`, this will download and start the container and keep it running in the background. If you already have something on port 80 change the first `80` to whatever open port you'd like.
|
||||
4. Run `docker exec -it sermon-notes bash install.sh` This will run an install script to create an .env file specific to your install, populate with the beginning factors, and then run a `composer` command to download the necessary package dependancies.
|
||||
5. Once complete you have a running system that you can navigate to in your browser with `http://{ip}:{port}`|`http://{hostname}:{port}`. Then you just need to register for an account. The first account that is created is made an admin so that you can access the `Reference Editor` and update any reference material if necessary.
|
||||
|
||||
|
||||
@@ -305,7 +305,12 @@ function newSpeaker() {
|
||||
* @return {Promise} A Promise that resolves with the results of the fetch request.
|
||||
*/
|
||||
function saveSpeaker(event) {
|
||||
if (event.keyCode == 13) {
|
||||
if (event.keyCode == 27) {
|
||||
document.querySelector('#newSpeaker').style.display = 'none';
|
||||
document.querySelector('#speaker').style.display = 'inline-block';
|
||||
document.querySelector('#speaker').value = 0;
|
||||
}
|
||||
if (event.keyCode == 13 && document.querySelector('#newSpeaker').value != '') {
|
||||
fetch('/save-speaker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -352,7 +357,12 @@ function newSeries() {
|
||||
* @return {Promise} A Promise that resolves with the response from the server.
|
||||
*/
|
||||
function saveSeries(event) {
|
||||
if (event.keyCode == 13) {
|
||||
if (event.keyCode == 27) {
|
||||
document.querySelector('#newSeries').style.display = 'none';
|
||||
document.querySelector('#series').style.display = 'inline-block';
|
||||
document.querySelector('#series').value = 0;
|
||||
}
|
||||
if (event.keyCode == 13 && document.querySelector('#newSeries').value != '') {
|
||||
fetch('/save-series', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -58,7 +58,7 @@ export function setEventListeners() {
|
||||
document.querySelector('#notes').addEventListener('keyup', function (event) {
|
||||
let key = event.keyCode;
|
||||
|
||||
if (key >= 48 && key <= 90 || key >= 96 && key <= 111 || key >= 186 && key <= 222) {
|
||||
if (key == 8 || key >= 48 && key <= 90 || key >= 96 && key <= 111 || key >= 186 && key <= 222) {
|
||||
textDirty = true;
|
||||
document.querySelector('#note-header-left h2').classList.add('dirty');
|
||||
}
|
||||
|
||||
@@ -15,37 +15,37 @@
|
||||
"erusev/parsedown": "^1.7",
|
||||
"phpdocumentor/reflection-docblock": "^5.4",
|
||||
"phpstan/phpdoc-parser": "^1.28",
|
||||
"symfony/asset": "7.2.*",
|
||||
"symfony/asset-mapper": "7.2.*",
|
||||
"symfony/console": "7.2.*",
|
||||
"symfony/debug-bundle": "7.2.*",
|
||||
"symfony/doctrine-messenger": "7.2.*",
|
||||
"symfony/dotenv": "7.2.*",
|
||||
"symfony/expression-language": "7.2.*",
|
||||
"symfony/asset": "7.3.*",
|
||||
"symfony/asset-mapper": "7.3.*",
|
||||
"symfony/console": "7.3.*",
|
||||
"symfony/debug-bundle": "7.3.*",
|
||||
"symfony/doctrine-messenger": "7.3.*",
|
||||
"symfony/dotenv": "7.3.*",
|
||||
"symfony/expression-language": "7.3.*",
|
||||
"symfony/flex": "^2",
|
||||
"symfony/form": "7.2.*",
|
||||
"symfony/framework-bundle": "7.2.*",
|
||||
"symfony/http-client": "7.2.*",
|
||||
"symfony/intl": "7.2.*",
|
||||
"symfony/mailer": "7.2.*",
|
||||
"symfony/mime": "7.2.*",
|
||||
"symfony/form": "7.3.*",
|
||||
"symfony/framework-bundle": "7.3.*",
|
||||
"symfony/http-client": "7.3.*",
|
||||
"symfony/intl": "7.3.*",
|
||||
"symfony/mailer": "7.3.*",
|
||||
"symfony/mime": "7.3.*",
|
||||
"symfony/monolog-bundle": "^3.0",
|
||||
"symfony/notifier": "7.2.*",
|
||||
"symfony/process": "7.2.*",
|
||||
"symfony/property-access": "7.2.*",
|
||||
"symfony/property-info": "7.2.*",
|
||||
"symfony/runtime": "7.2.*",
|
||||
"symfony/security-bundle": "7.2.*",
|
||||
"symfony/serializer": "7.2.*",
|
||||
"symfony/notifier": "7.3.*",
|
||||
"symfony/process": "7.3.*",
|
||||
"symfony/property-access": "7.3.*",
|
||||
"symfony/property-info": "7.3.*",
|
||||
"symfony/runtime": "7.3.*",
|
||||
"symfony/security-bundle": "7.3.*",
|
||||
"symfony/serializer": "7.3.*",
|
||||
"symfony/stimulus-bundle": "^2.17",
|
||||
"symfony/string": "7.2.*",
|
||||
"symfony/translation": "7.2.*",
|
||||
"symfony/twig-bundle": "7.2.*",
|
||||
"symfony/uid": "7.2.*",
|
||||
"symfony/string": "7.3.*",
|
||||
"symfony/translation": "7.3.*",
|
||||
"symfony/twig-bundle": "7.3.*",
|
||||
"symfony/uid": "7.3.*",
|
||||
"symfony/ux-turbo": "^2.17",
|
||||
"symfony/validator": "7.2.*",
|
||||
"symfony/web-link": "7.2.*",
|
||||
"symfony/yaml": "7.2.*",
|
||||
"symfony/validator": "7.3.*",
|
||||
"symfony/web-link": "7.3.*",
|
||||
"symfony/yaml": "7.3.*",
|
||||
"twig/extra-bundle": "^2.12|^3.0",
|
||||
"twig/twig": "^2.12|^3.0"
|
||||
},
|
||||
@@ -96,16 +96,16 @@
|
||||
"extra": {
|
||||
"symfony": {
|
||||
"allow-contrib": false,
|
||||
"require": "7.2.*"
|
||||
"require": "7.3.*"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"symfony/browser-kit": "7.2.*",
|
||||
"symfony/css-selector": "7.2.*",
|
||||
"symfony/browser-kit": "7.3.*",
|
||||
"symfony/css-selector": "7.3.*",
|
||||
"symfony/maker-bundle": "^1.0",
|
||||
"symfony/phpunit-bridge": "^7.2",
|
||||
"symfony/stopwatch": "7.2.*",
|
||||
"symfony/web-profiler-bundle": "7.2.*"
|
||||
"symfony/stopwatch": "7.3.*",
|
||||
"symfony/web-profiler-bundle": "7.3.*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
services:
|
||||
sermon-notes:
|
||||
container_name: sermon-notes
|
||||
image: ryanprather/sermon-notes:latest
|
||||
image: gitea.rkprather.com/ryan/sermon-notes:1.1
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- $PWD/data:/data
|
||||
- $PWD/.env:/var/www/html/.env
|
||||
- ${PWD}/data:/data
|
||||
- ${PWD}/.env:/var/www/html/.env
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -4,7 +4,6 @@ if [ ! -f /var/www/html/.env ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
echo "APP_ENV=prod" > .env
|
||||
echo "APP_DEBUG=0" >> .env
|
||||
|
||||
@@ -13,10 +12,11 @@ LENGTH=32
|
||||
SECRET_KEY=$(openssl rand -base64 $LENGTH | tr -d '=' | tr -d '+' | tr -d '/' | tr -d ' ')
|
||||
TRIMMED_KEY=$(cut -c1-32 <<< $SECRET_KEY)
|
||||
echo "APP_SECRET=$TRIMMED_KEY" >> .env
|
||||
echo "DATABASE_URL=\"sqlite:///data/data.db\"" >> .env
|
||||
echo "DATABASE_URL=\"sqlite:////data/data.db\"" >> .env
|
||||
echo "MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0" >> .env
|
||||
|
||||
COMPOSER_ALLOW_SUPERUSER=1 composer update
|
||||
symfony console asset-map:compile
|
||||
symfony console doctrine:migrations:migrate --no-interaction
|
||||
|
||||
chown -R www-data:www-data /data
|
||||
|
||||
@@ -3,6 +3,35 @@
|
||||
use App\Kernel;
|
||||
|
||||
if (file_exists(__DIR__.$_SERVER['REQUEST_URI']) && is_readable(__DIR__.$_SERVER['REQUEST_URI']) && is_file(__DIR__.$_SERVER['REQUEST_URI'])) {
|
||||
$header = 'text/html';
|
||||
if (substr($_SERVER['REQUEST_URI'], -4) == '.css')
|
||||
$header = 'text/css';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -3) == '.js')
|
||||
$header = 'text/javascript';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.ico')
|
||||
$header = 'image/x-icon';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.png')
|
||||
$header = 'image/png';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.jpg')
|
||||
$header = 'image/jpeg';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.gif')
|
||||
$header = 'image/gif';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -3) == '.wo' || substr($_SERVER['REQUEST_URI'], -6) == '.woff2')
|
||||
$header = 'font/woff2';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.ttf')
|
||||
$header = 'font/truetype';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.eot' || substr($_SERVER['REQUEST_URI'], -5) == '.ttf-')
|
||||
$header = 'application/vnd.ms-fontobject';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -4) == '.svg')
|
||||
$header = 'image/svg+xml';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -5) == '.json')
|
||||
$header = 'application/json';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -3) == '.otf')
|
||||
$header = 'font/opentype';
|
||||
elseif (substr($_SERVER['REQUEST_URI'], -5) == '.woff')
|
||||
$header = 'font/woff';
|
||||
|
||||
print header("Content-Type: $header; charset=UTF-8");
|
||||
print file_get_contents(__DIR__.$_SERVER['REQUEST_URI']);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Controller;
|
||||
|
||||
use App\Entity\Note;
|
||||
use App\Entity\User;
|
||||
use App\Entity\Speaker;
|
||||
use App\Entity\Series;
|
||||
use App\Entity\SharedNote;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -30,6 +32,8 @@ class DefaultController extends AbstractController
|
||||
$last4Notes = $emi->getRepository(Note::class)->getLast4Notes($user);
|
||||
$openNotes = $emi->getRepository(Note::class)->reverseNoteSort($user);
|
||||
$meta = $user->getMetaData();
|
||||
$speakers = $emi->getRepository(Speaker::class)->findBy(['user' => $user], ['name' => 'ASC']);
|
||||
$series = $emi->getRepository(Series::class)->findBy(['user' => $user], ['name' => 'ASC']);
|
||||
|
||||
return $this->render('default/home.html.twig', [
|
||||
//'onLoad' => 'initHome()',
|
||||
@@ -37,6 +41,8 @@ class DefaultController extends AbstractController
|
||||
'reverseNoteSort' => $openNotes,
|
||||
'isAdmin' => $this->isGranted('ROLE_ADMIN'),
|
||||
'meta' => $meta,
|
||||
'speakers' => $speakers,
|
||||
'series' => $series,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -72,7 +78,7 @@ class DefaultController extends AbstractController
|
||||
|
||||
$sharedWithMe = $emi->getRepository(SharedNote::class)->getNotesSharedWithMe($user);
|
||||
$shared = $emi->getRepository(SharedNote::class)->getNotesSharedByMe($user);
|
||||
dump($shared);
|
||||
//dump($shared);
|
||||
|
||||
return $this->render('default/profile.html.twig', [
|
||||
'onLoad' => 'rollUp("user");rollUp("settings")',
|
||||
|
||||
@@ -50,6 +50,9 @@ class RegistrationController extends AbstractController
|
||||
|
||||
return $this->redirectToRoute('app_home');
|
||||
}
|
||||
else {
|
||||
dd($form);
|
||||
}
|
||||
|
||||
return $this->render('registration/register.html.twig', [
|
||||
'registrationForm' => $form,
|
||||
|
||||
@@ -115,7 +115,7 @@ let saveFailureCount = {{ meta.saveFailureCount }};
|
||||
<select id="speaker" onchange='newSpeaker()'>
|
||||
<option value=0>-- Speaker --</option>
|
||||
<option value='new'>New Speaker</option>
|
||||
{% for s in app.user.speakers %}
|
||||
{% for s in speakers %}
|
||||
<option value='{{ s.id }}'>{{ s.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
@@ -123,7 +123,7 @@ let saveFailureCount = {{ meta.saveFailureCount }};
|
||||
<select id="series" onchange='newSeries()'>
|
||||
<option value=0>-- Series --</option>
|
||||
<option value='new'>New Series</option>
|
||||
{% for s in app.user.series %}
|
||||
{% for s in series %}
|
||||
<option value='{{ s.id }}'>{{ s.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
@@ -24,15 +24,9 @@
|
||||
<div id='main'>
|
||||
<div class='inner'>
|
||||
<header id="header">
|
||||
{% if app.user %}
|
||||
<a href='/home' class='logo'>
|
||||
<a href='/{% if app.user %}home{% endif %}' class='logo'>
|
||||
<img src='{{ asset('images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg') }}' style='width:60px;'/>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/" class="logo">
|
||||
<img src=' {{ asset('images/vecteezy_notes-icon-in-trendy-flat-style-isolated-on-white_29722382.jpg') }}' style='width:60px;'/>
|
||||
</a>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<!-- Banner -->
|
||||
|
||||
@@ -27,41 +27,19 @@
|
||||
{{ form_errors(registrationForm) }}
|
||||
|
||||
{{ form_start(registrationForm) }}
|
||||
{{ form_row(registrationForm.name) }}
|
||||
{{ form_row(registrationForm.email) }}
|
||||
<label for='registration_form_name' class='form-label'>Name</label>
|
||||
<input type='text' name='{{ field_name(registrationForm.name) }}' id='registration_form_name' class='form-control' required='required'/>
|
||||
|
||||
<label for='registration_form_email' class='form-label'>Email</label>
|
||||
<input type='text' name='{{ field_name(registrationForm.email) }}' id='registration_form_email' class='form-control' required='required'/>
|
||||
|
||||
|
||||
{{ form_row(registrationForm.plainPassword, {
|
||||
label: 'Password'
|
||||
}) }}
|
||||
|
||||
<button type='submit' class='btn' id='register-btn'>Register</button>
|
||||
{{ form_end(registrationForm) }}
|
||||
<!--
|
||||
<form action="/register" method="post" id='registration-form'>
|
||||
<input type="hidden" name="_csrf_token" id="csrfToken"
|
||||
value="{{ csrf_token('authenticate') }}"
|
||||
>
|
||||
<fieldset>
|
||||
<legend>Login Information</legend>
|
||||
<div class="input-container">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="input-container">
|
||||
<label for="emailAddress">Email Address:</label>
|
||||
<input type="email" id="emailAddress" name="email" required>
|
||||
</div>
|
||||
<div class="input-container">
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" id="password" name="plainPassword" required>
|
||||
</div>
|
||||
<div class="input-container">
|
||||
<label for="confirmPassword">Confirm Password:</label>
|
||||
<input type="password" id="confirmPassword" name="confirmPassword" required>
|
||||
</div>
|
||||
</fieldset>
|
||||
<button id='register-btn'>Register</button>
|
||||
<input type="submit" value="Register" />
|
||||
</form>-->
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user