{"id":18780569,"url":"https://github.com/codelinered/file-sharing","last_synced_at":"2025-06-22T06:03:56.834Z","repository":{"id":54276856,"uuid":"140576316","full_name":"CodelineRed/file-sharing","owner":"CodelineRed","description":"Platform to upload, download and share files","archived":false,"fork":false,"pushed_at":"2023-09-01T19:31:17.000Z","size":61354,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T06:03:48.733Z","etag":null,"topics":["download","files","gulp","share","slim3","upload"],"latest_commit_sha":null,"homepage":"https://fs.insanitymeetshh.net","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodelineRed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-11T13:05:25.000Z","updated_at":"2022-11-13T10:12:40.000Z","dependencies_parsed_at":"2024-11-07T20:31:40.283Z","dependency_job_id":"fafb4cd1-12ed-43eb-8403-d813c9c0cdd2","html_url":"https://github.com/CodelineRed/file-sharing","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/CodelineRed/file-sharing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2Ffile-sharing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2Ffile-sharing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2Ffile-sharing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2Ffile-sharing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodelineRed","download_url":"https://codeload.github.com/CodelineRed/file-sharing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelineRed%2Ffile-sharing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261243997,"owners_count":23129639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["download","files","gulp","share","slim3","upload"],"created_at":"2024-11-07T20:27:11.492Z","updated_at":"2025-06-22T06:03:51.300Z","avatar_url":"https://github.com/CodelineRed.png","language":"PHP","readme":"# File Sharing - CodelineRed\r\n\r\nThis git is for [fs.codelinered.net](https://fs.codelinered.net). Take a look at [screenshots](https://github.com/CodelineRed/file-sharing/tree/main/screenshots).\r\n\r\nThis application based on [Slim Skeleton](https://github.com/CodelineRed/file-sharing) and [Gulp Skeleton](https://github.com/CodelineRed/gulp-Skeleton).\r\n\r\n## Table of contents\r\n- [Included Third Party Code](#included)\r\n- Install Guides\r\n    - [Install Production Build (Recommended)](#install-production-build-recommended)\r\n    - [Install Main/ Develop Build](#install-main-develop-build)\r\n    - [Install with Docker (optional)](#install-with-docker-optional)\r\n- [Project Commands](#project-commands)\r\n- [`gulpfile.json`](#gulpfilejson)\r\n- [Path generation with Locale code and Generic locale code](#path-generation-with-locale-code-and-generic-locale-code)\r\n- [How to create further localisations](#how-to-create-further-localisations)\r\n- [How to switch between different url modes](#how-to-switch-between-different-url-modes)\r\n    - [Mode 1](#mode-1)\r\n    - [Mode 2](#mode-2)\r\n    - [Mode 3](#mode-3-default)\r\n- [ACL settings](#acl-settings)\r\n- [Troubleshooting](#troubleshooting)\r\n- [Links](#links)\r\n\r\n## Included\r\n- [Slim 3](https://www.slimframework.com)\r\n- [Slim Twig View 2](https://github.com/slimphp/Twig-View)\r\n- [Slim CSRF 0.8](https://github.com/slimphp/fs-Csrf)\r\n- [Slim Flash 0.4](https://github.com/slimphp/fs-Flash)\r\n- [Monolog 1](https://seldaek.github.io/monolog/)\r\n- [Doctrine ORM 2](https://packagist.org/packages/doctrine/orm)\r\n- [Geggleto ACL 1](https://github.com/geggleto/geggleto-acl)\r\n- [Google Authenticator](https://github.com/PHPGangsta/GoogleAuthenticator)\r\n- [Google reCAPTCHA 1](https://github.com/google/recaptcha)\r\n- [HTML Compress Twig Extension](https://github.com/nochso/html-compress-twig)\r\n\r\n\r\n## Install Production Build (Recommended)\r\n### Required\r\n- PHP 8.0\r\n- MySQL 5.7 (pdo_mysql)\r\n\r\n[Download zip](https://github.com/CodelineRed/file-sharing/archive/production.zip) if you don't have git or composer on your OS.\r\nOpen console on your OS and navigate to your project folder.\r\n```bash\r\n+++++ COMPOSER VERSION +++++\r\n$ php composer create-project codelinered/file-sharing file-sharing \"dev-production\" --no-dev\r\n$ cd file-sharing\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ GIT VERSION +++++\r\n$ git clone https://github.com/CodelineRed/file-sharing.git\r\n$ cd file-sharing\r\n$ git checkout production\r\n$ (optional on unix)  rm -rf .git\r\n$ (optional on win10) rmdir .git /s\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall --no-dev\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ ZIP VERSION +++++\r\n$ (unix) wget -O fs-prod.zip https://github.com/CodelineRed/file-sharing/archive/production.zip\r\n$ (unix) unzip fs-prod.zip\r\n$ (win10) curl -L -o fs-prod.zip https://github.com/CodelineRed/file-sharing/archive/production.zip\r\n$ (win10) tar -xf fs-prod.zip\r\n$ cd file-sharing-production\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall --no-dev\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n| Login    | Website  |\r\n|----------|----------|\r\n| Username | user     |\r\n| Password | password |\r\n\r\nIf you want to use Docker: [click here](#install-with-docker-optional)\r\n\r\n## Install Main/ Develop Build\r\n### Required\r\n- [Node.js](http://nodejs.org/en/download/)\r\n- [npm](http://www.npmjs.com/get-npm) `$ npm i npm@latest -g`\r\n- [gulp-cli](https://www.npmjs.com/package/gulp-cli) `$ npm i gulp-cli@latest -g`\r\n- PHP 8.0\r\n- MySQL 5.7 (pdo_mysql)\r\n\r\n[Download zip](https://github.com/CodelineRed/file-sharing/archive/main.zip) if you don't have git on your OS.\r\nOpen console on your OS and navigate to your project folder.\r\n```bash\r\n+++++ COMPOSER VERSION +++++\r\n$ php composer create-project codelinered/file-sharing file-sharing\r\n$ cd file-sharing\r\n$ npm i\r\n$ gulp build\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ GIT VERSION +++++\r\n$ git clone https://github.com/CodelineRed/file-sharing.git\r\n$ cd file-sharing\r\n$ npm i\r\n$ gulp build\r\n$ (optional on unix)  rm -rf .git\r\n$ (optional on win10) rmdir .git /s\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n```bash\r\n+++++ ZIP VERSION +++++\r\n$ (unix) wget -O fs-main.zip https://github.com/CodelineRed/file-sharing/archive/main.zip\r\n$ (unix) unzip fs-main.zip\r\n$ (win10) curl -L -o fs-main.zip https://github.com/CodelineRed/file-sharing/archive/main.zip\r\n$ (win10) tar -xf fs-main.zip\r\n$ cd file-sharing-main\r\n$ npm i\r\n$ gulp build\r\n$ (optional) cp config\\additional-settings.dist.php config\\additional-settings.php\r\n$ ---- Open \"config\\additional-settings.php\" and change everything you have to change ----\r\n$ php composer insall\r\n$ php doctrine dbal:run-sql \"CREATE DATABASE file_sharing\"\r\n$ php doctrine orm:schema-tool:update --force\r\n$ php doctrine dbal:import sql/all-records.sql\r\n```\r\n\r\n| Login    | Website  |\r\n|----------|----------|\r\n| Username | user     |\r\n| Password | password |\r\n\r\n## Install with Docker (optional)\r\n### Required\r\n- [Docker](https://www.docker.com/)\r\n\r\nOpen console on your OS and navigate to the place where you want to install the project.\r\n```bash\r\n$ ---- Unix ----\r\n$ systemctl docker start\r\n$ docker run --rm --interactive --tty --volume $PWD:/app composer create-project --ignore-platform-reqs --no-dev codelinered/file-sharing file-sharing \"dev-production\"\r\n$ cd file-sharing\r\n$ cp -n config/additional-settings.dist.php config/additional-settings.php\r\n$ docker run --rm --interactive --tty --volume $PWD:/app composer update --no-dev\r\n$ ---- Windows ----\r\n$ \"c:\\path\\to\\Docker Desktop.exe\"\r\n$ docker run --rm --interactive --tty --volume %cd%:/app composer create-project --ignore-platform-reqs --no-dev codelinered/file-sharing file-sharing \"dev-production\"\r\n$ cd file-sharing\r\n$ echo n | copy /-y config\\additional-settings.dist.php config\\additional-settings.php\r\n$ docker run --rm --interactive --tty --volume %cd%:/app composer update --no-dev\r\n$ --- All OS ----\r\n$ docker-compose build\r\n$ docker-compose up -d\r\n```\r\n\r\n| Login    | [Website](http://localhost:7710) | [Adminer](http://localhost:7712) |\r\n|----------|----------------------------------|----------------------------------|\r\n| Server   | -                                | database                         |\r\n| Username | user                             | root                             |\r\n| Password | password                         | rootdockerpw                     |\r\n| Database | -                                | -                                |\r\n\r\n## Project Commands\r\n|               | Description                                                                                                                            |\r\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------|\r\n| gulp          | watch files and start [BrowserSync](https://www.npmjs.com/package/browser-sync)                                                        |\r\n| gulp build    | executes following tasks: cleanUp, favicon, font, img, js, jsLint, json, scss, scssLint, svg                                           |\r\n| gulp lintAll  | executes following tasks: jsLint, scssLint                                                                                             |\r\n| gulp cleanUp  | clean up public folder                                                                                                                 |\r\n| gulp favicon  | generate favicons                                                                                                                      |\r\n| gulp font     | copy font files                                                                                                                        |\r\n| gulp img      | copy and compress images                                                                                                               |\r\n| gulp js       | uglify, minify and concat js files                                                                                                     |\r\n| gulp jsLint   | checks js follows [lint rules](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/js-lint.json)                 |\r\n| gulp json     | copy and minify json files                                                                                                             |\r\n| gulp scss     | compile, minify and concat scss files                                                                                                  |\r\n| gulp scssLint | checks scss follows [lint rules](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/scss-lint.json)             |\r\n| gulp svg      | copy and compress svg files                                                                                                            |\r\n| gulp watch    | watch scss, js, json, img, font and svg files                                                                                          |\r\n\r\n## [`gulpfile.json`](https://github.com/CodelineRed/file-sharing/blob/main/gulpfiles/app/gulpfile.dist.json)\r\n|                     | Description                                                                                                                      |\r\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------|\r\n| browserSyncConfig   | Required - Defines which config is used for [BrowserSync](https://www.npmjs.com/package/browser-sync) (default: browserSyncDocker) |\r\n| sourcePath          | Required - Path to raw files (default: gulpfiles/)                                                                               |\r\n| publicPath          | Required - Path to transpiled files (default: public/)                                                                           |\r\n| env                 | Required - Environment dev, test or prod (default: prod)                                                                         |\r\n\r\n## Path generation with Locale code and Generic locale code\r\n- Mode 1 - example.com/de/ = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Mode 2 - example.de = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_ENABLED,`\r\n- Mode 3 - example.com (de-DE session) = `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_SESSION | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,` (default)\r\n\r\nIt depends on your configuration what will be returned.\r\n\r\n|                     | Mode 1 | Mode 2 | Mode 3 |\r\n|---------------------|--------|--------|--------|\r\n| locale code         | de-DE  | de-DE  | xx-XX  |\r\n| generic locale code | de-DE  | xx-XX  | xx-XX  |\r\n\r\n|                     | Twig        | PHP                                   | Twig Example                            | PHP Example                                                                   |\r\n|---------------------|-------------|---------------------------------------|-----------------------------------------|-------------------------------------------------------------------------------|\r\n| locale code         | `{{ lc }}`  | `LanguageUtility::getLocale()`        | `{{ path_for('user-register-' ~ lc) }}` | `$this-\u003erouter-\u003epathFor('user-register-' . LanguageUtility::getLocale())`     |\r\n| generic locale code | `{{ glc }}` | `LanguageUtility::getGenericLocale()` | `{{ path_for('user-login-' ~ glc) }}`   | `$this-\u003erouter-\u003epathFor('user-login-' . LanguageUtility::getGenericLocale())` |\r\n\r\n## How to create further localisations\r\n- Duplicate one existing file in folder [`locale/`](https://github.com/CodelineRed/file-sharing/tree/main/locale) (e.g. copy `de-DE.php` to `fr-FR.php`)\r\n- (if you use Mode 1 or 2) Duplicate one existing file in folder [`config/routes/`](https://github.com/CodelineRed/file-sharing/tree/main/config/routes) (e.g. copy `de-DE.php` to `fr-FR.php`)\r\n- (if you use Mode 1 or 2) Change route prefix from `/de/` to `/fr/` in `config/routes/fr-FR.php`\r\n- You can also define paths like `/fr-be/` (`locale/fr-BE.php`/ `config/routes/fr-BE.php`) for example\r\n- If you want to show language in langswitch, add `fr-FR` and domain in `locale =\u003e active` ([`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L56))\r\n- (if you use Mode 1 or 2) Add case for `fr/` in [`src/localisation.php`](https://github.com/CodelineRed/file-sharing/blob/main/src/localisation.php#L47)\r\n\r\n## How to switch between different url modes\r\n### Mode 1\r\nExample: example.com/de/\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Set up english routes with or without `/en` prefix in [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php)\r\n- Set up german routes with `/de` prefix in [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)\r\n- [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php) can be leave untouched\r\n\r\n### Mode 2\r\nExample: de.example.com or example.de\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_URL | \\App\\Utility\\LanguageUtility::DOMAIN_ENABLED,`\r\n- Enter your domains in `active`\r\n- Go to [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)\r\n- Remove `/de` prefix from every `route`\r\n- Go to [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php)\r\n- Insert all routes where the config is equal between [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)\r\n- Remove these equal routes in [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) and [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)\r\n\r\n### Mode 3 (default)\r\nExample: example.com\r\n- EN is default language and DE is alternative language for this steps\r\n- Got to `locale` in [`config/additional-settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/additional-settings.dist.php#L52)\r\n- Set `'process' =\u003e \\App\\Utility\\LanguageUtility::LOCALE_SESSION | \\App\\Utility\\LanguageUtility::DOMAIN_DISABLED,`\r\n- Set up all routes in [`config/routes/xx-XX.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/xx-XX.php)\r\n- [`config/routes/en-US.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/en-US.php) can be leave untouched\r\n- [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php) can be leave untouched\r\n\r\n## ACL settings\r\nWith [Geggleto ACL](https://github.com/geggleto/geggleto-acl), routes are protected by role the current user has. By default every new route is not accessable until you give the route roles.\r\nRoutes are defined in the route files (e.g. [`config/routes/de-DE.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/routes/de-DE.php)).\r\nAny other resource is defined in [`config/settings.php`](https://github.com/CodelineRed/file-sharing/blob/main/config/settings.php#L90).\r\nInside the Twig templates you can use ACL functions [`has_role`](https://github.com/CodelineRed/file-sharing/blob/main/templates/partials/navigation.html.twig#L23) and is_allowed.\r\nInside controllers you can also use this ACL functions and [many more](https://github.com/geggleto/geggleto-acl/blob/main/src/AclRepository.php) (e.g. [`isAllowed()`](https://github.com/CodelineRed/file-sharing/blob/main/src/Controller/UserController.php#L101)).\r\n\r\n## Troubleshooting\r\nIn some cases you'll get the error message \"Internal Server Error\".\r\n\r\nIf this happened, go to [`public/.htaccess`](https://github.com/CodelineRed/file-sharing/blob/main/public/.htaccess) and enable `RewriteBase /`.\r\n\r\nIf project is in sub directory then `RewriteBase /project/public/`.\r\n\r\n## Links\r\n- [Slim Framework](https://www.slimframework.com/)\r\n- [Twig](https://twig.symfony.com/)\r\n- [Doctrine](https://www.doctrine-project.org/)\r\n- [Slim 3 and Doctrine 2 Website](http://blog.sub85.com/slim-3-with-doctrine-2.html)\r\n- [Slim 3 and Doctrine 2 Github](https://github.com/matthewfedak/slim-3-doctrine-2)\r\n- [DataTables Translations](https://datatables.net/plug-ins/i18n/)\r\n- [ESLint Rules](https://eslint.org/docs/rules/)\r\n- [Sass Lint Rules](https://github.com/sasstools/sass-lint/tree/develop/docs/rules)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelinered%2Ffile-sharing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelinered%2Ffile-sharing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelinered%2Ffile-sharing/lists"}