{"id":15502783,"url":"https://github.com/spookey/shorter","last_synced_at":"2025-10-12T06:31:41.243Z","repository":{"id":148056057,"uuid":"183830765","full_name":"spookey/shorter","owner":"spookey","description":"🦑","archived":true,"fork":false,"pushed_at":"2023-07-04T07:26:58.000Z","size":234,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T11:37:14.195Z","etag":null,"topics":["flask","privacy","sqlalchemy","unittests","url-shortener"],"latest_commit_sha":null,"homepage":"https://gitlab.com/spookey/shorter","language":"Python","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/spookey.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"2019-04-27T23:26:27.000Z","updated_at":"2023-07-04T08:40:38.000Z","dependencies_parsed_at":"2025-01-29T11:41:14.353Z","dependency_job_id":null,"html_url":"https://github.com/spookey/shorter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spookey/shorter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spookey%2Fshorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spookey%2Fshorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spookey%2Fshorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spookey%2Fshorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spookey","download_url":"https://codeload.github.com/spookey/shorter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spookey%2Fshorter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010507,"owners_count":26084757,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["flask","privacy","sqlalchemy","unittests","url-shortener"],"created_at":"2024-10-02T09:11:01.777Z","updated_at":"2025-10-12T06:31:40.920Z","avatar_url":"https://github.com/spookey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shorter\n\nThis is some kind of URL-shorter.\n\nGive it something that looks like an URL, and it will give you\nsome short link.\n\nOpening that short link will redirect you there.\n\n\n## Redirection\n\n* Short links are protected by the ``robots.txt``.\n* A ``nofollow`` attribute is added to the link on the redirection page.\n* The redirection page adds some ``X-Robots-Tag: noindex, nofollow`` header.\n* Known crawlers will receive a 403 (Forbidden) error page instead of\n  the redirection page.\n* Redirects are done via JavaScript and/or HTML meta tags to remove the\n  referrer.\n\n## Deployment\n\nCurrently it runs on some FreeBSD server.\nI won't get too specific here, but keep this in mind:\n\n* Configuration is done via environment variables.\n  Have a look into the ``shorter/start/environment.py`` file\n  (everything using ``getenv`` is configurable).\n\n* Use ``gmake`` for the ``makefile``\n\n* Do not forget to run ``gmake assets`` if using the default theme\n\nI am using mariadb as database, the setup is somewhat specific..\n\n* Create Database:\n    * Use ``utf8mb4`` because obvious reasons.\n    * Use ``utf8mb4_bin`` as collation, because the symbols used are case\n      sensitive.\n\n```mysql\n    CREATE DATABASE shorter CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_bin';\n```\n\n* Create user and set permissions:\n    * Choose a better password than this.\n\n```mysql\n    GRANT ALL ON shorter.* TO 'shorter'@'localhost' IDENTIFIED BY 'password';\n```\n\n* Check your settings:\n\n```mysql\n    USE shorter;\n    SELECT @@character_set_database, @@collation_database;\n```\n\nIt should output ``utf8mb4`` and ``utf8mb4_bin``.\n\n* Install the ``PyMySQL`` package into the virtual environment:\n    * You should have ``openssl`` for that.\n\n```sh\n    venv/bin/pip3 install -r requirements-mysql.txt\n```\n\n* Now create the ``short`` table:\n\n```sh\n    env \\\n        DEBUG=0 \\\n        FLASK_ENV='production' \\\n        DATABASE='mysql+pymysql://shorter:password@localhost/shorter?charset=utf8mb4' \\\n            gmake dbup\n```\n\nUse the same ``DATABASE`` string to run the application.\n\n\n### Manually fixing\n\nIn case anything got wrong, use these commands to manually fix them.\n\n```mysql\n  ALTER DATABASE shorter CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin;\n```\n\n```mysql\n  ALTER TABLE short CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;\n```\n\nMake sure to have a backup, before attempting this!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspookey%2Fshorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspookey%2Fshorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspookey%2Fshorter/lists"}