{"id":17223155,"url":"https://github.com/daboross/qxlc","last_synced_at":"2025-09-05T07:34:31.040Z","repository":{"id":17305795,"uuid":"20076356","full_name":"daboross/qxlc","owner":"daboross","description":"Paste/link/image server written in Python 3 using Flask","archived":false,"fork":false,"pushed_at":"2015-01-06T06:04:10.000Z","size":588,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T16:24:14.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://qx.lc","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daboross.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}},"created_at":"2014-05-22T20:43:22.000Z","updated_at":"2022-02-12T00:18:00.000Z","dependencies_parsed_at":"2022-09-14T22:40:18.042Z","dependency_job_id":null,"html_url":"https://github.com/daboross/qxlc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daboross/qxlc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fqxlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fqxlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fqxlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fqxlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daboross","download_url":"https://codeload.github.com/daboross/qxlc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daboross%2Fqxlc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273727536,"owners_count":25157132,"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-09-05T02:00:09.113Z","response_time":402,"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":[],"created_at":"2024-10-15T04:07:30.636Z","updated_at":"2025-09-05T07:34:31.018Z","avatar_url":"https://github.com/daboross.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"qxlc\n====\n\nMultipurpose flask-app written in Python 3.\n\nCurrently implemented:\n* Short link server\n* Paste server\n* *Private* image server.\n\nThe image server functionality currently doesn't resize images or confirm that they are images at all. Because of this,\nit is set up to require an API key.\n\nThis is a work in progress. Its current stable state runs at http://qx.lc, and development at http://dev.qx.lc\n\n#### Finding pastes with incorrect md5sums.\n\nI don't yet know how this might happen, but incase it does, do this:\n\n```\necho \"select id, data from qxlc_data where type = 1;\" | sqlite3 qxlc.db | python3 script.py pastes | sqlite3 qxlc.db\necho \"select id, data from qxlc_data where type = 2;\" | sqlite3 qxlc.db | python3 script.py images | sqlite3 qxlc.db\n```\n\nIf you are experiencing pasting something and having the resulting url have different content, the above may fix it.\n\n#### Installing\nYou can install qx.lc on your own server using nginx and uwsgi. You will need python3, nginx, uwsgi and virtualenv\ninstalled.\n\n##### 1)\n\nClone qxlc into /var/www/qxlc/ using git. `git clone https://github.com/daboross/qxlc.git /var/www/qxlc/`\n\n##### 2)\n\nChown /var/www/qxlc/ to whatever user your going to run qx.lc with. I use the user 'azd'.\n```\n[sudo] chown -Rc azd:azd /var/www/qxlc/\n```\n\n##### 3)\n\nCreate a virtualenv for qxlc to run in. I used the directory `/var/www/envs/qxlc/`, but feel free to use any dir. This\ndirectory should be owned by the user you are running qxlc under (in my case 'azd').\n```\n[sudo] mkdir /var/www/envs/\n[sudo] chown -Rc azd:azd /var/www/envs\ncd /var/www/envs/\nvirtualenv -p python3.4 qxlc\n```\n\n##### 4)\n\nActivate the new virtualenv, and install all required dependencies.\n```\nsource /var/www/envs/qxlc/bin/activate\npip install -r /var/www/qxlc/requirements.txt\n```\n\n##### 5)\n\nConfigure uwsgi to run qxlc. This can be done by creating a `/etc/uwsgi/apps-available/qxlc.ini` file, and putting the\nfollowing contents:\n```\n[uwsgi]\n# Bind to localhost port 3032\nsocket = 127.0.0.1:3032\n# Use the qxlc installation in /var/www/qxlc/\nwsgi-file = /var/www/qxlc/qxlc.wsgi\n# Use the virtualenv in /var/www/envs/qxlc/\nvirtualenv = /var/www/envs/qxlc/\ncallable = application\n# Use azd as the user/group for running qxlc\nuid = azd\ngid = azd\n# We aren't really loaded enough to need multiple processors\nprocesses = 1\n# Enable threads so that the github_pull function can use a ThreadPoolExecutor to execute\n# Since we're enabling threads anyways, might as well use two of them for serving content\nthreads = 2\n# Don't give write permission to group or other\numask = 022\n```\nYou probably want to change the `uid` and `gid` settings to match the user you are running qxlc under. You can also\nchange the `processes` and `threads` options to optimize for your machine. If you are running multiple uwsgi apps on the\nmachine you can also change the `:3032` part of the `socket` option, just be sure to change it in the nginx\nconfiguration file as well.\n\nThen enable the app by using `[sudo] ln -s /etc/uwsgi/apps-available/qxlc.ini /etc/uwsgi/apps-enabled/`.\n\n##### 6)\n\nConfigure nginx to run qxlc. This can be done by creating a `/etc/nginx/sites-available/qxlc` file, and putting the\nfollowing contents:\n```\n# Handle http requests for qx.lc\nserver {\n    # replace 107.161.17.250 and 2604:180:1::d4c6:e0de with your ipv4 and ipv6 addresses respectively.\n    listen 107.161.17.250:80;\n    listen [2604:180:1::d4c6:e0de]:80;\n    # replace qx.lc with your server name\n    server_name qx.lc;\n\n    location / {\n        include uwsgi_params;\n        # This should be the same as the `socket` option in the uwsgi conf\n        uwsgi_pass 127.0.0.1:3032;\n    }\n}\n```\n\nIf qxlc is the only web server running on the configured IP address, you can also add the following section to the\nconfiguration file to redirect all traffic to that IP address to qxlc. This will also handle www.\u003caddress\u003e/\u003caddress\u003e\nredirection.\n```\n# Redirect all http requests for unknown sites to qx.lc\nserver {\n    listen 107.161.17.250:80 default_server;\n    listen [2604:180:1::d4c6:e0de]:80 default_server;\n    # replace 'qx.lc' with your webserver address\n    return 301 $scheme://qx.lc/$request_uri;\n}\n```\n\n##### 7)\n\nCopy `/var/www/qxlc/config.default.json` to `/var/www/qxlc/config.json`. Then edit the config with the values you need for your setup.\n\n\"base_url\" should be the base URL for the qxlc app. It shouldn't have an ending slash. In my case, 'http://qx.lc'. This\nurl is used for giving out links.\n\n\"database\" should be the SQLAlchemy database URL for the database to store links and IDs in.\n\n##### 8)\n\nRestart uwsgi and reload nginx, and you should be good to go!\n\n```\n[sudo] service uwsgi restart\n[sudo] service nginx reload\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaboross%2Fqxlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaboross%2Fqxlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaboross%2Fqxlc/lists"}