Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbl committed Jul 5, 2016
2 parents ca88221 + ce450eb commit 8d5e177
Show file tree
Hide file tree
Showing 23 changed files with 445 additions and 363 deletions.
57 changes: 55 additions & 2 deletions README.md
Expand Up @@ -13,11 +13,13 @@ For more information please check out my [blog](http://michaelthessel.com/tag/pw
Example
============

https://pwx.michaelthessel.com
https://pwx.io

Installation
============

Download the current stable release [here](https://github.com/MichaelThessel/pwx/archive/v1.0.zip) or clone the repository.

Install dependencies:
```
# php composer.phar install
Expand All @@ -32,10 +34,16 @@ Create the database schema:
```
# app/console orm:schema-tool:create
```
Web server configuration
========================

The [Silex Documentation](http://silex.sensiolabs.org/doc/web_servers.html) has example configurations for Apache, nginx, IIS & Lighttpd.

Update
======

Download the latest source code.

If you are updating to a newer version follow these steps.

Update dependencies:
Expand All @@ -55,6 +63,7 @@ Currently:

* English (en)
* Spanish (es)
* Esperanto (eo)
* and German (de)

are supported by PWX. Please set locale according to your requirements in the
Expand All @@ -64,7 +73,7 @@ You can use a GET parameter when linking to PWX. I.e.

https://example.com?locale=es

This allows for one instance of PWX dynamically to be accessed in different
This allows for one instance of PWX dynamically being accessed in different
languages.

Themes
Expand Down Expand Up @@ -98,6 +107,50 @@ To run the integrated test suite please run:
```
# vendor/bin/phpunit
```
API
===

PWX offers a simple API with the following endpoints:

**Save an entry**

```
Request Methoud: POST
End Point: https://example.com/api
Params:
userName: string (default: "")
password: string (reqired)
comment: string (default: "")
expires: int (time in s from when the entry will expire, min: 1h, max: 30days, default: 3600)
oneTimeView: bool (whether or not the entry will be deleted after viewing it once, default: false)
Response:
hash string (id of entry)
```

**Retrieve an entry**

```
Request Methoud: GET
End Point: https://example.com/api/[hash]
Params:
n/a
Response:
hash: string
userName: string
password: string
comment: string
```

**Delete an entry**

```
Request Methoud: DELETE
End Point: https://example.com/api/[hash]
Params:
n/a
Response:
n/a
```

Warning
=======
Expand Down
11 changes: 2 additions & 9 deletions app/app.php
Expand Up @@ -30,6 +30,7 @@
'type' => 'annotation',
'namespace' => 'App\Entity',
'path' => __DIR__. '/../src/App/Entity',
'use_simple_annotation_reader' => false,
),
),
),
Expand All @@ -51,7 +52,7 @@
// Register DoctrineOrmServiceProvider service
$app->register(new Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), $config);

// Register theme service & set user theme
// Register register I18n service
$app['i18n_service'] = $app->share(function () { return new App\Service\I18nService(); });

// Register translation service
Expand Down Expand Up @@ -106,14 +107,6 @@ function () use ($app) {
$app['controllers']->requireHttps();
}

// Register theme service & set user theme
$app['theme_service'] = $app->share(
function () use ($app){
return new App\Service\ThemeService($app);
}
);
$app['theme_service']->setUserTheme();

// After middleware
$app->after(function (Request $request, Response $response) use ($app) {
// Set the locale cookie
Expand Down
6 changes: 4 additions & 2 deletions app/locales/de.yml
@@ -1,10 +1,14 @@
app.poweredby: Powered by
app.name: Passwort Austausch

app.meta.description: Internet Passwort Austausch Dienst
app.meta.keywords: Passwort, Austausch, Login, Zugangsdaten, Übermittlung, Email

app.data.username: Nutzername
app.data.password: Passwort
app.data.comment: Kommentar
app.data.expires: Gültig für
app.data.onetimeview: Nur einmal sichtbar
app.data.seconds: Sekunden
app.data.minutes: Minuten
app.data.hour: Stunde
Expand All @@ -16,8 +20,6 @@ app.data.month: Monat

app.language: Sprache

app.theme: Theme

index.generate: Generieren
index.insert_password_start: Zufälliges
index.insert_password_end: Zeichen langes Passwort einfügen
Expand Down
6 changes: 4 additions & 2 deletions app/locales/en.yml
@@ -1,10 +1,14 @@
app.poweredby: Powered by
app.name: Password Exchange

app.meta.description: Online password exchange service
app.meta.keywords: Password, Exchange, Online, Credentials, Transfer, Email

app.data.username: User Name
app.data.password: Password
app.data.comment: Comment
app.data.expires: Valid for
app.data.onetimeview: Delete record after it has been viewed
app.data.seconds: seconds
app.data.minutes: minutes
app.data.hour: hour
Expand All @@ -20,8 +24,6 @@ app.language.esperanto: Esperanto
app.language.german: Deutsch
app.language.spanish: Español

app.theme: Theme

index.generate: Generate
index.insert_password_start: Insert random
index.insert_password_end: character password
Expand Down
6 changes: 4 additions & 2 deletions app/locales/eo.yml
@@ -1,10 +1,14 @@
app.poweredby: Funkcianta per
app.name: Pasvort-interŝanĝo

app.meta.description: Interreta pasvort-interŝanĝa servo
app.meta.keywords: Pasvorto, Interŝanĝo, Interrete, Akreditilo, Transdoni, Retpoŝto

app.data.username: Salutnomo
app.data.password: Pasvorto
app.data.comment: Noto
app.data.expires: Valida por
app.data.onetimeview: Forigi la rekordon la unuan fojon ĝi estas montrata
app.data.seconds: sekundoj
app.data.minutes: minutoj
app.data.hour: horo
Expand All @@ -16,8 +20,6 @@ app.data.month: monato

app.language: Lingvo

app.theme: Etoso

index.generate: Krei
index.insert_password_start: Krei pasvorton el
index.insert_password_end: hazardaj signoj
Expand Down
4 changes: 4 additions & 0 deletions app/locales/es.yml
@@ -1,10 +1,14 @@
app.poweredby: Funciona con
app.name: Intercambio de contraseñas

app.meta.description: Servicio para el intercambio de contraseñas a través de Internet
app.meta.keywords: Contraseña, Intercambio, Online, En línea, Credenciales, Transferir, Email, Correo electrónico

app.data.username: Nombre de usuario
app.data.password: Contraseña
app.data.comment: Nota
app.data.expires: Válido por
app.data.onetimeview: Eliminar el registro la primera vez que se visualice
app.data.seconds: segundos
app.data.minutes: minutos
app.data.hour: hora
Expand Down
5 changes: 5 additions & 0 deletions app/routing.php
Expand Up @@ -5,3 +5,8 @@
$app->get('/link/{hash}', 'app.default_controller:viewLinkAction');
$app->get('/pw/{hash}', 'app.default_controller:viewPasswordAction');
$app->post('/delete', 'app.default_controller:deleteAction');

// Api
$app->post('/api', 'app.default_controller:apiPostAction');
$app->get('/api/{hash}', 'app.default_controller:apiViewAction');
$app->delete('/api/{hash}', 'app.default_controller:apiDeleteAction');
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -5,9 +5,10 @@
"require": {
"silex/silex": "~1.2",
"aptoma/silex-extras": "~1.2",
"symfony/config": "~2.7",
"symfony/symfony": "~2.7",
"symfony/twig-bridge": "~2.3",
"symfony/translation": "~2.7",
"symfony/config": "~2.7",
"symfony/yaml": "~2.7",
"phpunit/phpunit": "4.8.*",
"dflydev/doctrine-orm-service-provider": "1.0.*",
Expand Down

0 comments on commit 8d5e177

Please sign in to comment.