From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- overlays/bitlbee-discord/default.nix | 12 - overlays/bitlbee/bitlbee_long_nicks.patch | 56 --- overlays/bitlbee/default.nix | 5 - overlays/bonfire/default.nix | 36 -- overlays/bugwarrior/default.nix | 5 - overlays/bugwarrior/mantisbt.patch | 379 --------------- overlays/bundix/default.nix | 7 - overlays/databases/mysql/default.nix | 24 - overlays/databases/postgresql/default.nix | 8 - overlays/default.nix | 48 -- overlays/doing/default.nix | 10 - overlays/dwm/default.nix | 7 - overlays/dwm/dwm_config.h | 98 ---- overlays/elinks/default.nix | 14 - overlays/elinks/elinks.json | 15 - overlays/gitolite/default.nix | 8 - overlays/gitolite/invite | 172 ------- overlays/gitweb/default.nix | 7 - overlays/gitweb/theme/git-favicon.png | Bin 1125 -> 0 bytes overlays/gitweb/theme/git-logo.png | Bin 2412 -> 0 bytes overlays/gitweb/theme/gitweb.css | 783 ------------------------------ overlays/gitweb/theme/gitweb.js | 27 -- overlays/goaccess/default.nix | 13 - overlays/kanboard/default.nix | 18 - overlays/khal/default.nix | 8 - overlays/ledger/default.nix | 20 - overlays/lesspipe/default.nix | 5 - overlays/morph/default.nix | 5 - overlays/morph/dry-run.patch | 59 --- overlays/morph/verbose_nix.patch | 12 - overlays/neomutt/default.nix | 7 - overlays/neomutt/tx.patch | 44 -- overlays/nix-direnv/default.nix | 7 - overlays/nixops/default.nix | 20 - overlays/nixops/fix_glibc.patch | 15 - overlays/nixops/hetzner_cloud.patch | 480 ------------------ overlays/pass/default.nix | 5 - overlays/pass/pass-fix-pass-init.patch | 42 -- overlays/pelican/default.nix | 7 - overlays/php-packages/default.nix | 6 - overlays/php-packages/mysqli_patch.patch | 11 - overlays/postfix/default.nix | 3 - overlays/procps-ng/default.nix | 5 - overlays/python-packages/buildbot.nix | 8 - overlays/python-packages/default.nix | 29 -- overlays/sc-im/default.nix | 9 - overlays/shaarli/default.nix | 15 - overlays/shaarli/shaarli_ldap.patch | 425 ---------------- overlays/slrn/default.nix | 5 - overlays/taskwarrior/TW-1778_patch.diff | 12 - overlays/taskwarrior/default.nix | 16 - overlays/vcsh/default.nix | 7 - overlays/weechat/default.nix | 12 - overlays/ympd/default.nix | 5 - overlays/ympd/ympd-password-env.patch | 23 - overlays/ympd/ympd.json | 15 - 56 files changed, 3094 deletions(-) delete mode 100644 overlays/bitlbee-discord/default.nix delete mode 100644 overlays/bitlbee/bitlbee_long_nicks.patch delete mode 100644 overlays/bitlbee/default.nix delete mode 100644 overlays/bonfire/default.nix delete mode 100644 overlays/bugwarrior/default.nix delete mode 100644 overlays/bugwarrior/mantisbt.patch delete mode 100644 overlays/bundix/default.nix delete mode 100644 overlays/databases/mysql/default.nix delete mode 100644 overlays/databases/postgresql/default.nix delete mode 100644 overlays/default.nix delete mode 100644 overlays/doing/default.nix delete mode 100644 overlays/dwm/default.nix delete mode 100644 overlays/dwm/dwm_config.h delete mode 100644 overlays/elinks/default.nix delete mode 100644 overlays/elinks/elinks.json delete mode 100644 overlays/gitolite/default.nix delete mode 100755 overlays/gitolite/invite delete mode 100644 overlays/gitweb/default.nix delete mode 100644 overlays/gitweb/theme/git-favicon.png delete mode 100644 overlays/gitweb/theme/git-logo.png delete mode 100644 overlays/gitweb/theme/gitweb.css delete mode 100644 overlays/gitweb/theme/gitweb.js delete mode 100644 overlays/goaccess/default.nix delete mode 100644 overlays/kanboard/default.nix delete mode 100644 overlays/khal/default.nix delete mode 100644 overlays/ledger/default.nix delete mode 100644 overlays/lesspipe/default.nix delete mode 100644 overlays/morph/default.nix delete mode 100644 overlays/morph/dry-run.patch delete mode 100644 overlays/morph/verbose_nix.patch delete mode 100644 overlays/neomutt/default.nix delete mode 100644 overlays/neomutt/tx.patch delete mode 100644 overlays/nix-direnv/default.nix delete mode 100644 overlays/nixops/default.nix delete mode 100644 overlays/nixops/fix_glibc.patch delete mode 100644 overlays/nixops/hetzner_cloud.patch delete mode 100644 overlays/pass/default.nix delete mode 100644 overlays/pass/pass-fix-pass-init.patch delete mode 100644 overlays/pelican/default.nix delete mode 100644 overlays/php-packages/default.nix delete mode 100644 overlays/php-packages/mysqli_patch.patch delete mode 100644 overlays/postfix/default.nix delete mode 100644 overlays/procps-ng/default.nix delete mode 100644 overlays/python-packages/buildbot.nix delete mode 100644 overlays/python-packages/default.nix delete mode 100644 overlays/sc-im/default.nix delete mode 100644 overlays/shaarli/default.nix delete mode 100644 overlays/shaarli/shaarli_ldap.patch delete mode 100644 overlays/slrn/default.nix delete mode 100644 overlays/taskwarrior/TW-1778_patch.diff delete mode 100644 overlays/taskwarrior/default.nix delete mode 100644 overlays/vcsh/default.nix delete mode 100644 overlays/weechat/default.nix delete mode 100644 overlays/ympd/default.nix delete mode 100644 overlays/ympd/ympd-password-env.patch delete mode 100644 overlays/ympd/ympd.json (limited to 'overlays') diff --git a/overlays/bitlbee-discord/default.nix b/overlays/bitlbee-discord/default.nix deleted file mode 100644 index bf8e5db..0000000 --- a/overlays/bitlbee-discord/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -self: super: { - bitlbee-discord = super.bitlbee-discord.overrideAttrs(old: rec { - version = "master-3061edd"; - name = "bitlbee-discord-${version}"; - src = self.fetchFromGitHub { - rev = "master"; - owner = "sm00th"; - repo = "bitlbee-discord"; - sha256 = "07gjd4b0g09888gpaqwcjafr8m292y2qz0gzharxjh1k2jbs88g3"; - }; - }); -} diff --git a/overlays/bitlbee/bitlbee_long_nicks.patch b/overlays/bitlbee/bitlbee_long_nicks.patch deleted file mode 100644 index 70be092..0000000 --- a/overlays/bitlbee/bitlbee_long_nicks.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/bitlbee.h b/bitlbee.h -index 17ab2979..5858277e 100644 ---- a/bitlbee.h -+++ b/bitlbee.h -@@ -121,7 +121,7 @@ extern "C" { - #define CONTROL_TOPIC "Welcome to the control channel. Type \2help\2 for help information." - #define IRCD_INFO PACKAGE " " - --#define MAX_NICK_LENGTH 24 -+#define MAX_NICK_LENGTH 99 - - #define HELP_FILE VARDIR "help.txt" - #define CONF_FILE_DEF ETCDIR "bitlbee.conf" -diff --git a/tests/check_nick.c b/tests/check_nick.c -index ca5e5111..909fdcc9 100644 ---- a/tests/check_nick.c -+++ b/tests/check_nick.c -@@ -11,16 +11,16 @@ - START_TEST(test_nick_strip){ - int i; - const char *get[] = { "test:", "test", "test\n", -- "thisisaveryveryveryverylongnick", -- "thisisave:ryveryveryverylongnick", -+ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", -+ "thisis:averyveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", - "t::::est", - "test123", - "123test", - "123", - NULL }; - const char *expected[] = { "test", "test", "test", -- "thisisaveryveryveryveryl", -- "thisisaveryveryveryveryl", -+ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", -+ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", - "test", - "test123", - "_123test", -@@ -28,7 +28,7 @@ START_TEST(test_nick_strip){ - NULL }; - - for (i = 0; get[i]; i++) { -- char copy[60]; -+ char copy[260]; - strcpy(copy, get[i]); - nick_strip(NULL, copy); - fail_unless(strcmp(copy, expected[i]) == 0, -@@ -53,7 +53,7 @@ END_TEST - - START_TEST(test_nick_ok_notok) - { -- const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnick", -+ const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", - "\nillegalchar", "", "nick%", "123test", NULL }; - int i; - diff --git a/overlays/bitlbee/default.nix b/overlays/bitlbee/default.nix deleted file mode 100644 index 5183d01..0000000 --- a/overlays/bitlbee/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - bitlbee = super.bitlbee.overrideAttrs(old: { - patches = (old.patches or []) ++ [ ./bitlbee_long_nicks.patch ]; - }); -} diff --git a/overlays/bonfire/default.nix b/overlays/bonfire/default.nix deleted file mode 100644 index 6dc1034..0000000 --- a/overlays/bonfire/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -self: super: { - bonfire = let - click = self.python3Packages.click.overridePythonAttrs(old: rec { - version = "6.7"; - src = self.python3Packages.fetchPypi { - pname = "click"; - inherit version; - sha256 = "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi"; - }; - postPatch = '' - substituteInPlace click/_unicodefun.py --replace "'locale'" "'${self.locale}/bin/locale'" - ''; - doCheck = false; - }); - keyring = self.python3Packages.keyring.overridePythonAttrs(old: rec { - version = "20.0.1"; - src = self.python3Packages.fetchPypi { - pname = "keyring"; - inherit version; - sha256 = "963bfa7f090269d30bdc5e25589e5fd9dad2cf2a7c6f176a7f2386910e5d0d8d"; - }; - }); - in - super.bonfire.overridePythonAttrs(old: { - version = "0.0.8"; - src = self.fetchFromGitHub { - owner = "blue-yonder"; - repo = "bonfire"; - rev = "0a0f18469d484aba6871fa7421bbb2c00ccefcb0"; - sha256 = "1y2r537ibghhmk6jngw0zwvh1vn2bihqcvji50ffh1j0qc6q3x6x"; - }; - postPatch = ""; - propagatedBuildInputs = self.lib.subtractLists [ self.python3Packages.click self.python3Packages.keyring ] old.propagatedBuildInputs ++ [ click keyring ]; - meta.broken = false; - }); -} diff --git a/overlays/bugwarrior/default.nix b/overlays/bugwarrior/default.nix deleted file mode 100644 index 2b25985..0000000 --- a/overlays/bugwarrior/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - bugwarrior = super.python3Packages.bugwarrior.overridePythonAttrs(old: rec { - patches = old.patches or [] ++ [ ./mantisbt.patch ]; - }); -} diff --git a/overlays/bugwarrior/mantisbt.patch b/overlays/bugwarrior/mantisbt.patch deleted file mode 100644 index 85e5af1..0000000 --- a/overlays/bugwarrior/mantisbt.patch +++ /dev/null @@ -1,379 +0,0 @@ -diff --git a/bugwarrior/services/mantisbt.py b/bugwarrior/services/mantisbt.py -new file mode 100644 -index 0000000..e54af0d ---- /dev/null -+++ b/bugwarrior/services/mantisbt.py -@@ -0,0 +1,361 @@ -+from builtins import filter -+import re -+import six -+ -+import requests -+from jinja2 import Template -+ -+from bugwarrior.config import asbool, aslist, die -+from bugwarrior.services import IssueService, Issue, ServiceClient -+ -+import logging -+log = logging.getLogger(__name__) -+ -+ -+class MantisbtClient(ServiceClient): -+ def __init__(self, host, token): -+ self.host = host -+ self.session = requests.Session() -+ self.session.headers['Authorization'] = token -+ -+ def _api_url(self, path, **context): -+ """ Build the full url to the API endpoint """ -+ baseurl = "https://{}/api/rest".format(self.host) -+ return baseurl + path.format(**context) -+ -+ def get_user(self): -+ return self.json_response(self.session.get(self._api_url("/users/me"))) -+ -+ def get_projects(self): -+ return self._getter(self._api_url("/projects"), subkey="projects") -+ -+ def get_issues(self): -+ url = self._api_url("/issues?page_size=50") -+ return self._getter(url, page_size=50, subkey="issues") -+ -+ def get_assigned_issues(self): -+ """ Returns all issues assigned to authenticated user. -+ """ -+ url = self._api_url("/issues?page_size=50&filter_id=assigned") -+ return self._getter(url, page_size=50, subkey="issues") -+ -+ def get_monitored_issues(self): -+ """ Returns all issues monitored by authenticated user. -+ """ -+ url = self._api_url("/issues?page_size=50&filter_id=monitored") -+ return self._getter(url, page_size=50, subkey="issues") -+ -+ def get_reported_issues(self): -+ """ Returns all issues reported by authenticated user. -+ """ -+ url = self._api_url("/issues?page_size=50&filter_id=reported") -+ return self._getter(url, page_size=50, subkey="issues") -+ -+ def _getter(self, url, page_size=None, subkey=None): -+ """ Pagination utility. Obnoxious. """ -+ -+ results = [] -+ link = dict(next=url) -+ page_number = 1 -+ -+ while 'next' in link: -+ if page_size is not None: -+ response = self.session.get(link['next'] + "&page=" + str(page_number)) -+ else: -+ response = self.session.get(link['next']) -+ -+ json_res = self.json_response(response) -+ -+ if subkey is not None: -+ json_res = json_res[subkey] -+ -+ results += json_res -+ -+ if page_size is not None and len(json_res) == page_size: -+ page_number += 1 -+ else: -+ break -+ -+ return results -+ -+class MantisbtIssue(Issue): -+ TITLE = 'mantisbttitle' -+ BODY = 'mantisbtbody' -+ CREATED_AT = 'mantisbtcreatedon' -+ UPDATED_AT = 'mantisbtupdatedat' -+ CLOSED_AT = 'mantisbtclosedon' -+ URL = 'mantisbturl' -+ PROJECT = 'mantisbtproject' -+ NUMBER = 'mantisbtnumber' -+ USER = 'mantisbtuser' -+ CATEGORY = 'mantisbtcategory' -+ STATE = 'mantisbtstate' -+ -+ UDAS = { -+ TITLE: { -+ 'type': 'string', -+ 'label': 'Mantisbt Title', -+ }, -+ BODY: { -+ 'type': 'string', -+ 'label': 'Mantisbt Body', -+ }, -+ CREATED_AT: { -+ 'type': 'date', -+ 'label': 'Mantisbt Created', -+ }, -+ UPDATED_AT: { -+ 'type': 'date', -+ 'label': 'Mantisbt Updated', -+ }, -+ CLOSED_AT: { -+ 'type': 'date', -+ 'label': 'Mantisbt Closed', -+ }, -+ PROJECT: { -+ 'type': 'string', -+ 'label': 'Mantisbt Project', -+ }, -+ URL: { -+ 'type': 'string', -+ 'label': 'Mantisbt URL', -+ }, -+ NUMBER: { -+ 'type': 'numeric', -+ 'label': 'Mantisbt Issue #', -+ }, -+ USER: { -+ 'type': 'string', -+ 'label': 'Mantisbt User', -+ }, -+ CATEGORY: { -+ 'type': 'string', -+ 'label': 'Mantisbt Category', -+ }, -+ STATE: { -+ 'type': 'string', -+ 'label': 'Mantisbt State', -+ } -+ } -+ UNIQUE_KEY = (URL, NUMBER, ) -+ -+ def _normalize_tag(self, label): -+ return re.sub(r'[^a-zA-Z0-9]', '_', label) -+ -+ def to_taskwarrior(self): -+ body = self.record.get('description') -+ if body: -+ body = body.replace('\r\n', '\n') -+ -+ created = self.parse_date(self.record.get('created_at')) -+ updated = self.parse_date(self.record.get('updated_at')) -+ closed_date = None -+ if self.record["status"]["name"] in ["closed", "resolved"]: -+ for history in self.record.get("history", []): -+ if history.get("field", {}).get("name", "") == "status"\ -+ and history.get("new_value", {}).get("name", "") in ["closed", "resolved"]: -+ closed_date = history["created_at"] -+ closed = self.parse_date(closed_date) -+ -+ return { -+ 'project': self.record['project']['name'], -+ 'priority': self.origin['default_priority'], -+ 'annotations': self.get_annotations(), -+ 'tags': self.get_tags(), -+ 'entry': created, -+ 'end': closed, -+ -+ self.TITLE: self.record.get('summary'), -+ self.BODY: body, -+ self.CREATED_AT: created, -+ self.UPDATED_AT: updated, -+ self.CLOSED_AT: closed, -+ self.URL: self.get_url(), -+ self.PROJECT: self.record['project'].get('name'), -+ self.NUMBER: self.record['id'], -+ self.USER: self.record['reporter'].get('name'), -+ self.CATEGORY: self.record['category'].get('name'), -+ self.STATE: self.record['status'].get('label'), -+ } -+ -+ def get_url(self): -+ return "https://{}view.php?id={}".format(self.extra['host'], self.record["id"]) -+ -+ def get_annotations(self): -+ annotations = [] -+ -+ context = self.record.copy() -+ annotation_template = Template(self.origin['annotation_template']) -+ -+ for annotation_dict in self.record.get('notes', []): -+ context.update({ -+ 'text': annotation_dict['text'], -+ 'date': annotation_dict['created_at'], -+ 'author': annotation_dict['reporter'].get('name', 'unknown'), -+ 'view': annotation_dict['view_state']['label'], -+ }) -+ annotations.append( -+ annotation_template.render(context) -+ ) -+ return annotations -+ -+ def get_tags(self): -+ tags = [] -+ -+ context = self.record.copy() -+ tag_template = Template(self.origin['tag_template']) -+ -+ for tag_dict in self.record.get('tags', []): -+ context.update({ -+ 'tag': self._normalize_tag(tag_dict['name']) -+ }) -+ tags.append( -+ tag_template.render(context) -+ ) -+ -+ return tags -+ -+ def get_default_description(self): -+ return self.build_default_description( -+ title=self.record['summary'], -+ url=self.get_processed_url(self.get_url()), -+ number=self.record['id'], -+ ) -+ -+ -+class MantisbtService(IssueService): -+ ISSUE_CLASS = MantisbtIssue -+ CONFIG_PREFIX = 'mantisbt' -+ -+ def __init__(self, *args, **kw): -+ super(MantisbtService, self).__init__(*args, **kw) -+ -+ self.host = self.config.get('host', 'www.mantisbt.org/bugs/') -+ -+ token = self.get_password('token') -+ -+ self.client = MantisbtClient(self.host, token) -+ self.user = None -+ -+ self.exclude_projects = self.config.get('exclude_projects', [], aslist) -+ self.include_projects = self.config.get('include_projects', [], aslist) -+ -+ self.involved_issues = self.config.get( -+ 'involved_issues', default=True, to_type=asbool -+ ) -+ self.assigned_issues = self.config.get( -+ 'assigned_issues', default=False, to_type=asbool -+ ) -+ self.monitored_issues = self.config.get( -+ 'monitored_issues', default=False, to_type=asbool -+ ) -+ self.reported_issues = self.config.get( -+ 'reported_issues', default=False, to_type=asbool -+ ) -+ self.tag_template = self.config.get( -+ 'tag_template', default='{{tag}}', to_type=six.text_type -+ ) -+ self.annotation_template = self.config.get( -+ 'annotation_template', default='{{date}} {{author}} ({{view}}): {{text}}', to_type=six.text_type -+ ) -+ -+ def get_service_metadata(self): -+ return { -+ 'tag_template': self.tag_template, -+ 'annotation_template': self.annotation_template, -+ } -+ -+ def filter_involved_issues(self, issue): -+ _, issue = issue -+ user = self.client.get_user() -+ uid = user["id"] -+ if issue["reporter"]["id"] != uid and \ -+ issue.get("handler", {}).get("id") != uid and \ -+ all([ x.get("user", {}).get("id") != uid for x in issue.get("history", [])]) and \ -+ all([ x.get("user", {}).get("id") != uid for x in issue.get("monitors", [])]): -+ return False -+ return self.filter_project_name(issue["project"]["name"]) -+ -+ def filter_issues(self, issue): -+ _, issue = issue -+ return self.filter_project_name(issue["project"]["name"]) -+ -+ def filter_project_name(self, name): -+ if self.exclude_projects: -+ if name in self.exclude_projects: -+ return False -+ -+ if self.include_projects: -+ if name in self.include_projects: -+ return True -+ else: -+ return False -+ -+ return True -+ -+ @staticmethod -+ def get_keyring_service(service_config): -+ host = service_config.get('host', 'www.mantisbt.org/bugs/') -+ username = service_config.get('username', default='nousername') -+ return "mantisbt://{username}@{host}".format(username=username, -+ host=host) -+ -+ @staticmethod -+ def to_issue_dict(issues): -+ return { i['id']: i for i in issues } -+ -+ def get_owner(self, issue): -+ return issue.get("handler", {}).get("name") -+ -+ def get_author(self, issue): -+ return issue.get("reporter", {}).get("name") -+ -+ def issues(self): -+ issues = {} -+ is_limited = self.assigned_issues or self.monitored_issues or self.reported_issues -+ -+ if self.assigned_issues: -+ issues.update( -+ filter(self.filter_issues, self.to_issue_dict(self.client.get_assigned_issues()).items()) -+ ) -+ if self.monitored_issues: -+ issues.update( -+ filter(self.filter_issues, self.to_issue_dict(self.client.get_monitored_issues()).items()) -+ ) -+ if self.reported_issues: -+ issues.update( -+ filter(self.filter_issues, self.to_issue_dict(self.client.get_reported_issues()).items()) -+ ) -+ -+ if not is_limited: -+ all_issues = self.to_issue_dict(self.client.get_issues()) -+ if self.involved_issues: -+ issues.update( -+ filter(self.filter_involved_issues, all_issues.items()) -+ ) -+ else: -+ issues.update( -+ filter(self.filter_issues, all_issues.items()) -+ ) -+ -+ log.debug(" Found %i issues.", len(issues)) -+ if not is_limited: -+ issues = list(filter(self.include, issues.values())) -+ else: -+ issues = list(issues.values()) -+ log.debug(" Pruned down to %i issues.", len(issues)) -+ -+ for issue in issues: -+ issue_obj = self.get_issue_for_record(issue) -+ extra = { -+ 'host': self.host -+ } -+ issue_obj.update_extra(extra) -+ yield issue_obj -+ -+ @classmethod -+ def validate_config(cls, service_config, target): -+ if 'token' not in service_config: -+ die("[%s] has no 'mantisbt.token'" % target) -+ -+ super(MantisbtService, cls).validate_config(service_config, target) -diff --git a/setup.py b/setup.py -index d6d957a..665e36e 100644 ---- a/setup.py -+++ b/setup.py -@@ -80,6 +80,7 @@ setup(name='bugwarrior', - activecollab2=bugwarrior.services.activecollab2:ActiveCollab2Service - activecollab=bugwarrior.services.activecollab:ActiveCollabService - jira=bugwarrior.services.jira:JiraService -+ mantisbt=bugwarrior.services.mantisbt:MantisbtService - megaplan=bugwarrior.services.megaplan:MegaplanService - phabricator=bugwarrior.services.phab:PhabricatorService - versionone=bugwarrior.services.versionone:VersionOneService diff --git a/overlays/bundix/default.nix b/overlays/bundix/default.nix deleted file mode 100644 index 6c4046c..0000000 --- a/overlays/bundix/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - bundix = super.bundix.overrideAttrs (old: { - preBuild = (old.preBuild or "") + '' - sed -i -e "/case obj/a\ when nil\n nil" lib/bundix/nixer.rb - ''; - }); -} diff --git a/overlays/databases/mysql/default.nix b/overlays/databases/mysql/default.nix deleted file mode 100644 index f9e5791..0000000 --- a/overlays/databases/mysql/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -self: super: rec { - mariadb_pam = super.mariadb.overrideAttrs(old: { - cmakeFlags = old.cmakeFlags ++ [ "-DWITH_AUTHENTICATION_PAM=ON" ]; - buildInputs = old.buildInputs ++ [ self.pam ]; - outputs = old.outputs ++ [ "dev" ]; - postInstall = '' - mkdir -p $dev $dev/lib $dev/share - cp -a $out/include $dev - cp -a $out/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} $dev/lib - cp -a $out/lib/pkgconfig $dev/lib - cp -a $out/share/aclocal $dev/share - '' + old.postInstall; - }); - # This patched version includes C headers from the server part (see - # above). It seems to be required to build pam support in clients. - libmysqlclient_pam = super.libmysqlclient.overrideAttrs(old: { - prePatch = old.prePatch or "" + '' - sed -i -e '/define INCLUDE/s|"$| -I@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql/server -I@CMAKE_SYSROOT@@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql/server/private"|' mariadb_config/mariadb_config.c.in - ''; - postInstall = old.postInstall or "" + '' - cp -a ${mariadb_pam.dev}/include/* $out/include/mariadb - ''; - }); -} diff --git a/overlays/databases/postgresql/default.nix b/overlays/databases/postgresql/default.nix deleted file mode 100644 index 9ada29c..0000000 --- a/overlays/databases/postgresql/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -self: super: rec { - postgresql_pam = super.postgresql_11.overrideAttrs(old: { - # datadir in /var/lib/postgresql is named after psqlSchema - passthru = old.passthru // { psqlSchema = "11.0"; }; - configureFlags = old.configureFlags ++ [ "--with-pam" ]; - buildInputs = (old.buildInputs or []) ++ [ self.pam ]; - }); -} diff --git a/overlays/default.nix b/overlays/default.nix deleted file mode 100644 index bdc99d2..0000000 --- a/overlays/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -let - flakeCompat = import ../lib/flake-compat.nix; - flakes = builtins.foldl' (a: b: a // b) {} (map (n: (flakeCompat n).overlays) [ - ../flakes/backports - ../flakes/openarc - ../flakes/opendmarc - ../flakes/peertube - ../flakes/private/peertube - ]); -in flakes // { - mylibs = self: super: { mylibs = import ../lib { pkgs = self; }; }; - mypkgs = self: super: import ../pkgs { pkgs = self; }; - - bitlbee = import ./bitlbee; - bitlbee-discord = import ./bitlbee-discord; - bonfire = import ./bonfire; - bundix = import ./bundix; - bugwarrior = import ./bugwarrior; - dwm = import ./dwm; - elinks = import ./elinks; - gitweb = import ./gitweb; - gitolite = import ./gitolite; - goaccess = import ./goaccess; - kanboard = import ./kanboard; - ledger = import ./ledger; - lesspipe = import ./lesspipe; - mysql = import ./databases/mysql; - neomutt = import ./neomutt; - nixops = import ./nixops; - pass = import ./pass; - pelican = import ./pelican; - php-packages = import ./php-packages; - postfix = import ./postfix; - postgresql = import ./databases/postgresql; - procps-ng = import ./procps-ng; - sc-im = import ./sc-im; - shaarli = import ./shaarli; - slrn = import ./slrn; - taskwarrior = import ./taskwarrior; - vcsh = import ./vcsh; - weechat = import ./weechat; - ympd = import ./ympd; - doing = import ./doing; - khal = import ./khal; - nix-direnv = import ./nix-direnv; - morph = import ./morph; -} -// import ./python-packages diff --git a/overlays/doing/default.nix b/overlays/doing/default.nix deleted file mode 100644 index 7f95fb6..0000000 --- a/overlays/doing/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -self: super: { - defaultGemConfig = super.defaultGemConfig // { - doing = attrs: { - postInstall = '' - installPath=$(cat $out/nix-support/gem-meta/install-path) - sed -i $installPath/lib/doing/wwid.rb -e "/Create a backup copy for the undo command/ {n;d}" - ''; - }; - }; -} diff --git a/overlays/dwm/default.nix b/overlays/dwm/default.nix deleted file mode 100644 index 96ed3ff..0000000 --- a/overlays/dwm/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - dwm = super.dwm.overrideAttrs(old: rec { - postPatch = '' - cp ${./dwm_config.h} ./config.h - ''; - }); -} diff --git a/overlays/dwm/dwm_config.h b/overlays/dwm/dwm_config.h deleted file mode 100644 index b1587e8..0000000 --- a/overlays/dwm/dwm_config.h +++ /dev/null @@ -1,98 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "monospace:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Nextcloud", NULL, NULL, 9 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[M]", monocle }, /* first entry is default */ - { "[]=", tile }, - { "><>", NULL }, /* no layout function means floating behavior */ -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "st", NULL }; - -static Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY, XK_t, spawn, {.v = termcmd } }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_Return, zoom, {0} }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - diff --git a/overlays/elinks/default.nix b/overlays/elinks/default.nix deleted file mode 100644 index 1744dc0..0000000 --- a/overlays/elinks/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -self: super: { - elinks = super.elinks.overrideAttrs (old: - self.mylibs.fetchedGithub ./elinks.json // rec { - preConfigure = ''sh autogen.sh''; - buildInputs = old.buildInputs ++ (with self; [ gettext automake autoconf ]); - configureFlags = [ - "--disable-smb" "--without-x" "--enable-cgi" - "--enable-leds" "--enable-256-colors" - "--enable-html-highlight" "--with-zlib" - ]; - patches = []; - } - ); -} diff --git a/overlays/elinks/elinks.json b/overlays/elinks/elinks.json deleted file mode 100644 index ea13b1f..0000000 --- a/overlays/elinks/elinks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tag": "f86be65-master", - "meta": { - "name": "elinks", - "url": "https://github.com/nabetaro/elinks", - "branch": "master" - }, - "github": { - "owner": "nabetaro", - "repo": "elinks", - "rev": "f86be659718c0cd0a67f88b42f07044c23d0d028", - "sha256": "1jxb7xgawcjkb3gw4gqyw26g02709wwdbhyczfckh3l4njxhy14m", - "fetchSubmodules": true - } -} diff --git a/overlays/gitolite/default.nix b/overlays/gitolite/default.nix deleted file mode 100644 index 7f8f007..0000000 --- a/overlays/gitolite/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -self: super: { - gitolite = super.gitolite.overrideAttrs(old: { - postPatch = old.postPatch + '' - sed -i -e "s@/bin/rm@rm@" src/commands/sskm - cp ${./invite} src/commands/invite - ''; - }); -} diff --git a/overlays/gitolite/invite b/overlays/gitolite/invite deleted file mode 100755 index 3cc2dbd..0000000 --- a/overlays/gitolite/invite +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use lib $ENV{GL_LIBDIR}; -use Gitolite::Rc; -use Gitolite::Common; - -=for usage -Please see usage at https://www.immae.eu/docs/forge-logicielle/gitolite.html#inviter-des-collaborateurs -=cut - -usage() if @ARGV and ($ARGV[0] eq '-h' or $ARGV[0] eq '--help'); - -my $rb = $rc{GL_REPO_BASE}; -my $ab = $rc{GL_ADMIN_BASE}; -# get to the keydir -_chdir("$ab/keydir"); - -# save arguments for later -my $operation = shift || 'list'; -my $invitekeyid = shift || ''; -$invitekeyid and $invitekeyid !~ /^[-0-9a-z_]+@[-0-9a-z_]+$/i and die "invalid keyid $invitekeyid\n"; -my ($invited, $keyid) = split /@/, $invitekeyid; - -# get the actual userid and keytype -my $gl_user = $ENV{GL_USER}; -die "This function is reserved for actual users" if $gl_user =~ s/-invite-(.*)$//; - -# ---- -# first collect the keys - -my ( @invited_keys ); - -for my $pubkey (`find . -type f -name "*.pub" | sort`) { - chomp($pubkey); - $pubkey =~ s(^./)(); # artifact of the find command - - my $user = $pubkey; - $user =~ s(.*/)(); # foo/bar/baz.pub -> baz.pub - $user =~ s/(\@[^.]+)?\.pub$//; # baz.pub, baz@home.pub -> baz - - if ( $user =~ m(^(zzz-marked-for-...-)?$gl_user-invite-) ) { - push @invited_keys, $pubkey; - } -} - -# ---- -# list mode; just do it and exit -sub print_keylist { - my ( $message, @list ) = @_; - return unless @list; - print "== $message ==\n"; - my $count = 1; - for (@list) { - my $fp = fingerprint($_); - s/(zzz-marked-for-...-)?$gl_user-invite-//g; - s/\.pub$//; - s(.*/)(); - print $count++ . ": $fp : $_\n"; - } -} -if ( $operation eq 'list' ) { - print "you have the following invited keys:\n"; - print_keylist( "keys for invited persons", @invited_keys ); - print "\n\n"; - exit; -} - -# ---- -# please see docs for details on how a user interacts with this - -die "valid operations: add, del\n" unless $operation =~ /^(add|del)$/; - -if ( $operation eq 'add' ) { - print STDERR "please supply the new key on STDIN. (I recommend you - don't try to do this interactively, but use a pipe)\n"; - kf_add( $gl_user, $invited, $keyid, safe_stdin() ); -} elsif ( $operation eq 'del' ) { - kf_del( $gl_user, $invited, $keyid ); -} - -exit; - -# ---- - -# make a temp clone and switch to it -our $TEMPDIR; -BEGIN { $TEMPDIR = `mktemp -d -t tmp.XXXXXXXXXX`; } -END { `rm -rf $TEMPDIR`; } - -sub cd_temp_clone { - chomp($TEMPDIR); - hushed_git( "clone", "$rb/gitolite-admin.git", "$TEMPDIR" ); - chdir($TEMPDIR); - my $hostname = `hostname`; chomp($hostname); - hushed_git( "config", "--get", "user.email" ) and hushed_git( "config", "user.email", $ENV{USER} . "@" . $hostname ); - hushed_git( "config", "--get", "user.name" ) and hushed_git( "config", "user.name", "$ENV{USER} on $hostname" ); -} - -sub fingerprint { - my ($fp, $output) = ssh_fingerprint_file(shift); - # Do not print the output of $output to an untrusted destination. - die "does not seem to be a valid pubkey\n" unless $fp; - return $fp; -} - -sub safe_stdin { - # read one line from STDIN - my $data; - my $ret = read STDIN, $data, 4096; - # current pubkeys are approx 400 bytes so we go a little overboard - die "could not read pubkey data" . ( defined($ret) ? "" : ": $!" ) . "\n" unless $ret; - die "pubkey data seems to have more than one line\n" if $data =~ /\n./; - return $data; -} - -sub hushed_git { - local (*STDOUT) = \*STDOUT; - local (*STDERR) = \*STDERR; - open( STDOUT, ">", "/dev/null" ); - open( STDERR, ">", "/dev/null" ); - system( "git", @_ ); -} - -sub highlander { - # there can be only one - my ( $keyid, $die_if_empty, @a ) = @_; - # too many? - if ( @a > 1 ) { - print STDERR " -more than one key satisfies this condition, and I can't deal with that! -The keys are: - -"; - print STDERR "\t" . join( "\n\t", @a ), "\n\n"; - exit 1; - } - # too few? - die "no keys with " . ( $keyid || "empty" ) . " keyid found\n" if $die_if_empty and not @a; - - return @a; -} - -sub kf_add { - my ( $gl_user, $invited, $keyid, $keymaterial ) = @_; - - # add a new "invited" key for $gl_user. - cd_temp_clone(); - chdir("keydir"); - - mkdir("invited"); - _print( "invited/$gl_user-invite-$invited\@$keyid.pub", $keymaterial ); - hushed_git( "add", "." ) and die "git add failed\n"; - my $fp = fingerprint("invited/$gl_user-invite-$invited\@$keyid.pub"); - hushed_git( "commit", "-m", "invite add $gl_user-invite-$invited\@$keyid ($fp)" ) and die "git commit failed\n"; - system("gitolite push >/dev/null 2>/dev/null") and die "git push failed\n"; -} - -sub kf_del { - my ( $gl_user, $invited, $keyid ) = @_; - - cd_temp_clone(); - chdir("keydir"); - - my @pk = highlander( $keyid, 1, grep { m(^(.*/)?(zzz-marked-for-...-)?$gl_user-invite-$invited\@$keyid.pub$) } @invited_keys ); - - my $fp = fingerprint( $pk[0] ); - hushed_git( "rm", $pk[0]) and die "git mv failed\n"; - hushed_git( "commit", "-m", "invite del $pk[0] ($fp)" ) and die "git commit failed\n"; - system("gitolite push >/dev/null 2>/dev/null") and die "git push failed\n"; -} diff --git a/overlays/gitweb/default.nix b/overlays/gitweb/default.nix deleted file mode 100644 index 27a1152..0000000 --- a/overlays/gitweb/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - gitweb = super.gitweb.overrideAttrs(old: { - postBuild = old.postBuild or "" + '' - cp -r ${./theme} $out/gitweb-theme; - ''; - }); -} diff --git a/overlays/gitweb/theme/git-favicon.png b/overlays/gitweb/theme/git-favicon.png deleted file mode 100644 index 4fa44bb..0000000 Binary files a/overlays/gitweb/theme/git-favicon.png and /dev/null differ diff --git a/overlays/gitweb/theme/git-logo.png b/overlays/gitweb/theme/git-logo.png deleted file mode 100644 index fdaf7b7..0000000 Binary files a/overlays/gitweb/theme/git-logo.png and /dev/null differ diff --git a/overlays/gitweb/theme/gitweb.css b/overlays/gitweb/theme/gitweb.css deleted file mode 100644 index 83e0742..0000000 --- a/overlays/gitweb/theme/gitweb.css +++ /dev/null @@ -1,783 +0,0 @@ -/* Reset -------------------------------------------------------------------------- */ - -/* Based on http://meyerweb.com/eric/tools/css/reset/ */ -/* v1.0 | 20080212 */ - -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, -blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, -font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, -u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, -caption, tbody, tfoot, thead, tr, th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; -} - -ol, ul { list-style: none; } - -blockquote, q { quotes: none; } - -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} - -:focus { outline: 0; } - -ins { text-decoration: none; } - -del { text-decoration: line-through; } - -table { - border-collapse: collapse; - border-spacing: 0; -} - -a { outline: none; } - -/* General ----------------------------------------------------------------------------- */ - -html { - position: relative; - min-height: 100%; -} - -body { - font: 13px Helvetica,arial,freesans,clean,sans-serif; - line-height: 1.4; - margin: 0 0 105px; - background-color: #fff; - color: #000000; -} - -/* Monospaced Fonts */ -.sha1, .mode, .diff_tree .list, .pre, .diff, .patchset { - font-family: 'Consolas','Bitstream Vera Sans Mono',monospace; -} - -a:link, a:visited { - color: #4183C4; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -td.list a[href*='tree'], td.list a[href*='blob'] { - padding-left: 20px; - display: block; - float: left; - height: 16px; - line-height: 16px; -} - -td.list a[href*='tree'] { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABq0lEQVQ4y8WTu4oUQRSGv+rtGVuxhwVFdFEEE2c3d0HYTEMTn8DEVxADQTDUF9DMwMxQMBMx8AEWzRQ3cBHd9TI91+2urjq/QbczY2IygSep4nD+79yqnCRWsYQVbWVACvDh5ZXdrLe15dwyT1TjT/sxFFeB6i+VA2B6+cb7kAI4Jf0LO087zjlQI8Y5Qvnj0sHug321XoC1bk+K9eHk6+s7wPMUgKAS88eqb4+Jfg2SHs7lZBvX2Nh+2EUCDGSAcMnJsx9f7NxfAGqXyDzRd5EJO/pMPT1gcviGTnYOVIN5pAAE8v7dLrKL8xnglFk4ws9Afko9HpH3b5Gd2mwb/lOBmgrSdYhJugDUCenxM6xv3p4HCsP8F0LxCsUhCkMURihOyM7fg0osASTFEpu9a4LjGIUCqwcoDiEUrX+E4hRUQb20RiokC1j9vckUhygU7X3QZh7NAVKYL7YBeMkRUfjVCotF2XGIwnghtrJpMywB5G0QZj9P1JNujuWJ1AHLQadRrACPkuZ0SSSWpeStWgDK6tHek5vbiOs48n++XQHurcf0rFng//6NvwG+iB9/4duaTgAAAABJRU5ErkJgggo=) center left no-repeat; -} - -td.list a[href*='blob'] { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAA6ElEQVQoFQXBMW5TQRgGwNnHnoE0QbiCjoIooUmTU3AuS1BwIoTSUdJBigg3GCWOg9/++zHTop078wIAsPMrE4SL5/1aIyMjIyMjz/m0tbFECFdrPeaQQw75mz/5nZH7fN7aWILmauSYfznmmIfss8vIUx7zZWsTTXM5vpWvTk5Wq9VHQP/gtgOLa0Qpw940vAQdaG6thpOhlOkG0AEuAVGmEkAH+G4YSikxXQM6wDsAMRFAB/ihDNNUmN4DOsAbBAEAdICfpmmaAt4COoj2GgCASbIkZh1NAACznhQt2itnFgAAlF3u/gMDtJXPzQxoswAAAABJRU5ErkJgggo=) center left no-repeat; -} - -i { - font-style: normal; -} - -td, th { - padding: 5px; -} - -.page_nav br { - display: none; -} - -/* Page Header ----------------------------------------------------------------------------- */ - -.page_header { - height: 50px; - line-height: 50px; - position: relative; - padding: 0 27px; - margin-bottom: 20px; - font-size: 20px; - font-family: Helvetica, Arial, Freesans, Clean, sans-serif; - background: #FFFFFF; /* old browsers */ - background: -moz-linear-gradient(top, #FFFFFF 0%, #F5F5F5 100%); /* firefox */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#F5F5F5)); /* webkit */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#F5F5F5',GradientType=0 ); /* ie */ - background: -o-linear-gradient(top, #FFFFFF 0%, #F5F5F5 100%); - border-bottom: 1px solid #dfdfdf; -} - -.page_header a:link, .page_header a:visited { - color: #4183C4; - text-decoration: none; - padding: 3px; - font-weight: bold; -} - -.page_header a:hover { - font-weight: bold; - padding: 3px; - text-decoration: underline; -} - -.page_header a:first-child { - background: transparent; -} - -.page_header img.logo { - position: relative; - top: 7px; - margin-right: 5px; -} - -/* Page Footer ----------------------------------------------------------------------------- */ - -.page_footer { - position: absolute; - left: 0; - bottom: 0; - width: 100%; - height: 80px; - line-height: 80px; - margin-top: 15px; - background: #f1f1f1; - border-top: 2px solid #ddd; - border-bottom: 1px solid #ddd; -} - -.page_footer_text { - color: #666; - display: inline; - float: left; - margin-left: 25px; - width: 80%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -a.rss_logo { - float: right; - padding: 3px 1px; - width: 35px; - line-height: 10px; - border: 1px solid; - border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e; - color: #ffffff; - background-color: #ff6600; - font-weight: bold; - font-family: sans-serif; - font-size: 80%; - text-align: center; - text-decoration: none; - margin-top: 30px; - margin-left: 5px; -} - -a.rss_logo:hover { - background-color: #ee5500; -} - -.rss_logo { - margin-right: 25px; - background: yellow; -} - -.rss_logo:last-child { - margin-right: 5px; -} - -/* Index include ----------------------------------------------------------------------------- */ - -.index_include { - width: 95%; - margin: 0 auto 15px; - background: -moz-linear-gradient(center top , #FFFFFF 0%, #F5F5F5 100%) repeat scroll 0 0 transparent; - border: 1px solid #DFDFDF; - padding: 8px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -/* Elements ----------------------------------------------------------------------------- */ - -.project_list, -.shortlog, -.tree, -.commit_search, -.history { - width: 95%; - margin: 0 auto 15px auto; - border: 1px solid #d8d8d8; - -moz-box-shadow: 0 0 3px rgba(0,0,0,0.2); - -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.2); - box-shadow: 0 0 3px rgba(0,0,0,0.2); -} - -.project_list th, -.shortlog th, -.tree th, -.commit_search th { - color: #afafaf; - font-weight: normal; -} - -.project_list th { - font-weight: bold; -} - -.project_list tr, -.shortlog tr, -.tree tr, -.commit_search tr { - background: #eaeaea; - height: 2.5em; - text-align: left; - color: #545454; -} - -.project_list tr.dark, .project_list tr.light, -.shortlog tr.dark, .shortlog tr.light, -.tree tr.dark, .tree tr.light, -.commit_search tr.dark, .commit_search tr.light, -.history tr.dark, .history tr.light, -.heads tr.dark, .heads tr.light { - background: #F9F9F9; /* old browsers */ - background: -moz-linear-gradient(top, #F9F9F9 0%, #EFEFEF 100%); /* firefox */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F9F9F9), color-stop(100%,#EFEFEF)); /* webkit */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F9F9F9', endColorstr='#EFEFEF',GradientType=0 ); /* ie */ - background: -o-linear-gradient(top, #F9F9F9 0%, #EFEFEF 100%); - height: 2.5em; - border-bottom: 1px solid #e1e1e1; -} - -th .header { - background: transparent; - border: 0; - padding: 0; - font-weight: bold; -} - -.tree { - width: 100%; - margin: 0; -} - -.projsearch { - position: absolute; - right: 4%; - top: 15px; -} - -.projsearch a { - display: none; -} - -.commit_search { - background: #eaeaea; -} - -.page_nav, -.list_head, -.page_path, -.search { - width: 94%; - background: #eaeaea; - color: #545454; - border: 1px solid #d8d8d8; - padding: 5px; - margin: 0 auto 15px auto; -} - -.history { - background: #eaeaea; -} - -.title { - margin: 0 auto 15px auto; - padding: 5px; - width: 95%; -} - -.readme { - background: #eaf2f5; - border: 1px solid #bedce7; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - margin: 0 auto 15px auto; - padding: 15px; - width: 95%; -} - -.readme h1 { - display: block; - font-size: 2em; - font-weight: bold; - margin-bottom: 0.67em; - margin-top: 0; -} - -.readme h2 { - font-size: 1.5em; - font-weight: bold; - margin-bottom: 0.83em; -} - - -.readme h3 { - font-size: 1.17em; - font-weight: bold; - margin-bottom: 1em; -} - -.readme p { - margin-bottom: 1em; -} - -.readme ul { - list-style: disc; - margin-bottom: 1em; - margin-left: 1.5em; -} - -.readme ul ul { - margin-bottom: 0; -} - -.readme ol { - list-style: decimal; - margin-bottom: 1em; - margin-left: 1.5em; -} - -.readme ol ol { - margin-bottom: 0; -} - -.readme pre { - font-family: monospace; - margin: 1em 0; - white-space: pre; -} - -.readme tt, .readme code, .readme kbd, .readme samp { - font-family: monospace; -} - -.readme blockquote { - margin: 1em; -} - -.projects_list, -.tags { - width: 95%; - background: #f0f0f0; - color: #545454; - border: 1px solid #d8d8d8; - padding: 5px; - margin: 0 auto 15px auto; -} - -.heads { - width: 95%; - color: #545454; - border: 1px solid #d8d8d8; - padding: 5px; - margin: 0 auto 15px auto; -} - -.header { - width: 94%; - margin: 0 auto 15px auto; - background: #eaf2f5; - border: 1px solid #bedce7; - padding: 5px; -} - -.header .age { - float: left; - color: #000; - font-weight: bold; - width: 10em; -} - -.title_text { - width: 94%; - background: #eaf2f5; - border: 1px solid #bedce7; - padding: 5px; - margin: 0 auto 0 auto; -} - -.log_body { - width: 94%; - background: #eaf2f5; - border: 1px solid #bedce7; - border-top: 0; - padding: 5px; - margin: 0 auto 15px auto; -} - -.page_body { - line-height: 1.4em; - width: 94%; - background: #f8f8f8; - border: 1px solid #d8d8d8; - padding: 5px; - margin: 15px auto 15px auto; -} - -.diff_tree { - width: 95%; - background: #f0f0f0; - border: 1px solid #d8d8d8; - padding: 5px; - margin: 0 auto 15px auto; -} - -.page_body > .list_head { - width: 98.5%; -} - -.page_body > .diff_tree { - width: 99.5%; -} - -.patch > .header { - width: 99%; -} - -.author .avatar, -.author_date .avatar { - position: relative; - top: 3px; -} - -.object_header .avatar { - border: 1px solid #D8D8D8; - float: right; -} - -.object_header td, -.object_header th { - vertical-align: top; -} - -/* Refs ----------------------------------------------------------------------------- */ - -span.refs span { - color: #707070; - display: inline-block; - margin: 0; - background-color: #eee; - border: 1px solid #ccc; - border-radius: 3px; - height: 18px; - padding: 0 6px; - text-overflow: ellipsis; -} - -span.refs span.ref { - color: #707070; - display: inline-block; - margin: 0; - background-color: #c4c4ff; - border: 1px solid #7878ff; - border-radius: 3px; - height: 18px; - padding: 0 6px; - text-overflow: ellipsis; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSUnpolg7AAAAHJQTFRFAAAAVVWqZmbMVVXVYGDgbW3td3fuc3PzdHT0cHD1d3f6dHT6dnb7dHT7dnb8dnb8dnb9d3f9dnb+eHj+d3f+eHj+d3f+d3f+d3f+eHj+d3f+eHj+d3f+eHj+d3f+d3f+eHj+d3f+d3f+d3f+eHj/////V9oQhQAAACR0Uk5TAAIEBQcNDhMVGCotNTZAT217i5CgobvExtjZ4eLr7vP09ff7uqQ6cgAAAAFiS0dEJcMByQ8AAABUSURBVBjTpc43AoAwDENRh95bgNBM1f3PyOpslD++RSJ61YgH5M2IbIkn4GocSR1MZVBL4t2n4FgkbaxI8Sqph041WknZCWAIrcmEUbpf3lNe0N9u59YFYHnZ78gAAAAASUVORK5CYII=); - background-repeat: no-repeat; - padding-left: 18px; -} - -span.refs span.tag { - color: #707070; - display: inline-block; - margin: 0; - background-color: #ffffab; - border: 1px solid #d9d93b; - border-radius: 3px; - height: 18px; - padding: 0 6px; - text-overflow: ellipsis; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSUZZ+h9RwAAAGZQTFRFAAAAtrYkwMBAwMBAx8c4yso11NQ71NQ51dU52Ng71tY519c719c719c62Ng719c719c62Ng72dk62Ng62Ng72Ng72dk62Ng72Ng62dk62dk72dk62Ng62dk72Ng72Ng72dk7////ou/AnQAAACB0Uk5TAAYHCxESLjRCWWlqa4uNkpissbrO19jc3ufs8vf6/f7atAU2AAAAAWJLR0QhxGwNFgAAAF1JREFUGFeNy0cOgCAABVGw94rY5d//lC7omhhn+ZIh5Gf1xPk0Zi5dAABROIQjSU/fsAXhDkCUljAv8jW2wlQpaixpo4Nj+dtatVpjkSJjLNaizRVpvhBCu/4h391jzw1lU12Z7wAAAABJRU5ErkJggg==); - background-repeat: no-repeat; - padding-left: 18px; -} - -span.refs span.head { - color: #707070; - display: inline-block; - margin: 0; - background-color: #c4ffc4; - border: 1px solid #78ff78; - border-radius: 3px; - height: 18px; - padding: 0 6px; - text-overflow: ellipsis; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSYDsafX/gAAAUpJREFUOMvVkjFLA0EQhd/s7l06MSCihbV/wC5/QBDEIFYWprRIIQQJFqKFQi4kUbBQsFSwtrUQLQULUTBFLCzVIgimCXe7z0q5yIWcqfRVwzDzMTNvgL8mSUqWw3JOtFQJdsIwLDYyjdYgkEmkazl2oVtQWk36nn8AYBYASmFpxmizGtnoqO7Vb+M9KglEkASdpWU872nvVCiPRpuTnz2JIHGyqX3d0kZfR1G0Ht+g/do+FIhOBbLW3n/FNb/28D0puZ+dyL44ur1UoH5yzt2JyIj6UGdDgwrPhYzSagNEszJaeU/lWlylbmnaeGZZICsAppxzi6nt73HK85oQCMknOuarpno+FIjglVjZDXaCS2yDv3rIHlCb88FY0BlUl3hs7ektkhckb5DFWhoz+n12zr7ZPLpYUqLm0oBMn8NUzLhpAgjpWMS/1CcSJ3ykD7Rk1QAAAABJRU5ErkJggg==); - background-repeat: no-repeat; - padding-left: 18px; -} - -span.refs a { - color: #4e4e4e; - font: 11px "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, monospace; - line-height: 18px; -} - -/* Diffs ----------------------------------------------------------------------------- */ - -div.diff.to_file a.path, -div.diff.to_file { - color: #007000; -} - -div.diff.from_file a.path, -div.diff.from_file { - color: #aa0000; -} - -.patch .header { - margin: 0; -} - -.patchset { - overflow-x: auto; - overflow-y: hidden; -} - -.chunk_header { - background: #eaf2f5; - color: #999; -} - -.rem { - background: #ffdddd; -} -.rem .marked { - background: #ffaaaa; -} -.add { - background: #ddffdd; -} -.add .marked { - background: #7dff7d; -} - -.extended_header { - width: 99.5%; -} - -div.chunk_block { - overflow: hidden; -} - -div.chunk_block div.old { - float: left; - width: 50%; - overflow: hidden; - border-right: 5px solid #EAF2F5; -} - -div.chunk_block.rem, -div.chunk_block.add { - background: transparent; -} - -div.chunk_block div.old .add, -div.chunk_block div.old .rem { - padding-right: 3px; -} - -div.chunk_block div.new .add, -div.chunk_block div.new .rem { - padding-left: 3px; -} - -div.chunk_block div.new { - margin-left: 50%; - width: 50%; - border-left: 5px solid #EAF2F5; -} - -/* Category ----------------------------------------------------------------------------- */ - -td.category { - background: #E6F1F6; /* old browsers */ - background: -moz-linear-gradient(top, #C8D8E7 0%, #E6F1F3 100%); /* firefox */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#C8D8E7), color-stop(100%,#E6F1F3)); /* webkit */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C8D8E7', endColorstr='#E6F1F3',GradientType=0 ); /* ie */ - background: -o-linear-gradient(top, #C8D8E7 0%, #E6F1F3 100%); - font-weight: bold; - border-bottom: 1px solid #D1D1D1; - border-top: 1px solid #D1D1D1; -} - -/* Age ----------------------------------------------------------------------------- */ - -/* noage: "No commits" */ -.project_list td.noage { - color: #cdcdcd; -} - -/* age2: 60*60*24*2 <= age */ -.project_list td.age2, .blame td.age2 { - color: #545454; -} - -/* age1: 60*60*2 <= age < 60*60*24*2 */ -.project_list td.age1 { - color: #009900; -} - -/* age0: age < 60*60*2 */ -.project_list td.age0 { - color: #009900; - font-weight: bold; -} - -/* File status ----------------------------------------------------------------------------- */ - -.diff_tree span.file_status.new { - color: #008000; -} - -table.diff_tree span.file_status.deleted { - color: #c00000; -} - -table.diff_tree span.file_status.moved, -table.diff_tree span.file_status.mode_chnge { - color: #545454; -} - -table.diff_tree span.file_status.copied { - color: #70a070; -} - -span.cntrl { - border: dashed #aaaaaa; - border-width: 1px; - padding: 0px 2px 0px 2px; - margin: 0px 2px 0px 2px; -} - -span.match { - background: #aaffaa; - color: #000; -} - -td.error { - color: red; - background: yellow; -} - -/* blob view */ - -td.pre, div.pre, div.diff { - white-space: pre-wrap; -} - -/* JavaScript-based timezone manipulation */ - -.popup { /* timezone selection UI */ - position: absolute; - /* "top: 0; right: 0;" would be better, if not for bugs in browsers */ - top: 0; left: 0; - border: 1px solid #d8d8d8; - padding: 2px; - background-color: #f0f0f0; - font-style: normal; - color: #545454; - cursor: auto; -} - -.close-button { /* close timezone selection UI without selecting */ - /* float doesn't work within absolutely positioned container, - * if width of container is not set explicitly */ - /* float: right; */ - position: absolute; - top: 0px; right: 0px; - border: 1px solid #ffaaaa; - margin: 1px 1px 1px 1px; - padding-bottom: 2px; - width: 12px; - height: 10px; - font-size: 9px; - font-weight: bold; - text-align: center; - background-color: #ffdddd; - cursor: pointer; -} - -/* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */ - -/* Highlighting theme definition: */ - -.num { color:#6ecf36; } -.esc { color:#ff00ff; } -.str { color:#ff00d3; background-color: #edc9ec } -.dstr { color:#818100; } -.slc { color:#838183; font-style:italic; } -.com { color:#838183; font-style:italic; } -.dir { color:#008200; } -.sym { color:#000000; } -.line { color:#555555; } -.kwa { color:#666666; font-weight:bold; } -.kwb { color:#6b3099; } -.kwc { color:#d4663d; } -.kwd { color:#2928ff; } - -/**** Styles supplémentaires *****/ - -.readme div.toc { - float: right; - border: 1px solid black; - background-color: white; -} -.readme div.toc span.toctitle { - display: inline-block; - width: 100%; - text-align: center; - font-weight: bold; -} - -.readme table { - background-color: white; -} - -.readme table thead tr { - background-color: #ccc; -} - -.readme table tbody tr:nth-child(2n) { - background-color: #f8f8f8; -} - -.readme table td, .readme table th { - border: 1px solid black; -} diff --git a/overlays/gitweb/theme/gitweb.js b/overlays/gitweb/theme/gitweb.js deleted file mode 100644 index 72f3cfa..0000000 --- a/overlays/gitweb/theme/gitweb.js +++ /dev/null @@ -1,27 +0,0 @@ -function include(filename, onload) { - var head = document.getElementsByTagName('head')[0]; - var script = document.createElement('script'); - script.src = filename; - script.type = 'text/javascript'; - script.onload = script.onreadystatechange = function() { - if (script.readyState) { - if (script.readyState === 'complete' || script.readyState === 'loaded') { - script.onreadystatechange = null; - onload(); - } - } - else { - onload(); - } - } - head.appendChild(script); -} - -include('static/gitweb.js', function() {}); -include('//code.jquery.com/jquery-3.1.0.min.js', function() { - $("div.title").each(function(index, element) { - if ($(element).text() === "readme" || $(element).text() === " ") { - $(element).hide(); - } - }); -}); diff --git a/overlays/goaccess/default.nix b/overlays/goaccess/default.nix deleted file mode 100644 index 6b9758b..0000000 --- a/overlays/goaccess/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -self: super: { - goaccess = super.goaccess.overrideAttrs(old: rec { - name = "goaccess-${version}"; - version = "1.4"; - src = self.fetchurl { - url = "https://tar.goaccess.io/${name}.tar.gz"; - sha256 = "1gkpjg39f3afdwm9128jqjsfap07p8s027czzlnxfmi5hpzvkyz8"; - }; - configureFlags = old.configureFlags ++ [ "--enable-tcb=btree" ]; - buildInputs = old.buildInputs ++ [ self.tokyocabinet self.bzip2 ]; - }); - -} diff --git a/overlays/kanboard/default.nix b/overlays/kanboard/default.nix deleted file mode 100644 index 05f2882..0000000 --- a/overlays/kanboard/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -self: super: { - kanboard = { kanboard_config ? "/etc/kanboard/config.php" }: - super.kanboard.overrideAttrs(old: rec { - name = "kanboard-${version}"; - version = "1.2.9"; - src = self.fetchFromGitHub { - owner = "kanboard"; - repo = "kanboard"; - rev = "c4152316b14936556edf3bcc4d11f16ba31b8ae7"; - sha256 = "1hdr95cpxgdzrzhffs63gdl0g7122ma2zg8bkqwp42p5xphx0xan"; - }; - installPhase = '' - cp -a . $out - ln -s ${kanboard_config} $out/config.php - mv $out/data $out/dataold - ''; - }); -} diff --git a/overlays/khal/default.nix b/overlays/khal/default.nix deleted file mode 100644 index 597cc0e..0000000 --- a/overlays/khal/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -self: super: { - khal = super.khal.overridePythonAttrs(old: { - postPatch = '' - sed -i "s/Invalid value for \"ics\"/Invalid value for \\\'ics\\\'/" tests/cli_test.py - sed -i "s/Invalid value for \"\[ICS\]\"/Invalid value for \\\'[ICS]\\\'/" tests/cli_test.py - ''; - }); -} diff --git a/overlays/ledger/default.nix b/overlays/ledger/default.nix deleted file mode 100644 index 9f2df57..0000000 --- a/overlays/ledger/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: super: { - ledger = super.ledger.overrideAttrs(old: rec { - #name = "${old.pname}-${version}"; - #version = "3.2.1"; - #src = self.fetchFromGitHub { - # owner = "ledger"; - # repo = "ledger"; - # rev = "v${version}"; - # sha256 = "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"; - #}; - patches = old.patches or [] ++ [ - (self.fetchpatch { - name = "xdgconfig.patch"; - url = "https://github.com/ledger/ledger/commit/c79674649dee7577d6061e3d0776922257520fd0.patch"; - sha256 = "0n82mjz9i17800r7vs45sxpss14rivsf1j8hrv7jal24iyfm01dz"; - excludes = [ "doc/NEWS.md" ]; - }) - ]; - }); -} diff --git a/overlays/lesspipe/default.nix b/overlays/lesspipe/default.nix deleted file mode 100644 index e53feae..0000000 --- a/overlays/lesspipe/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - lesspipe = super.lesspipe.overrideAttrs(old: { - configureFlags = (old.configureFlags or []) ++ [ "--yes" ]; - }); -} diff --git a/overlays/morph/default.nix b/overlays/morph/default.nix deleted file mode 100644 index 448f051..0000000 --- a/overlays/morph/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - morph = super.morph.overrideAttrs(old: { - patches = (old.patches or []) ++ [ ./verbose_nix.patch ./dry-run.patch ]; - }); -} diff --git a/overlays/morph/dry-run.patch b/overlays/morph/dry-run.patch deleted file mode 100644 index 2ff099e..0000000 --- a/overlays/morph/dry-run.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/morph.go b/morph.go -index a88414b..e5894df 100644 ---- a/morph.go -+++ b/morph.go -@@ -542,6 +542,7 @@ func getNixContext() *nix.NixContext { - return &nix.NixContext{ - EvalMachines: filepath.Join(assetRoot, assets.Friendly, "eval-machines.nix"), - ShowTrace: showTrace, -+ DryRun: *dryRun, - KeepGCRoot: *keepGCRoot, - AllowBuildShell: *allowBuildShell, - } -@@ -574,8 +575,10 @@ func buildHosts(hosts []nix.Host) (resultPath string, err error) { - return - } - -- fmt.Fprintln(os.Stderr, "nix result path: ") -- fmt.Println(resultPath) -+ if resultPath != "" { -+ fmt.Fprintln(os.Stderr, "nix result path: ") -+ fmt.Println(resultPath) -+ } - return - } - -diff --git a/nix/nix.go b/nix/nix.go -index 6a9cfd5..0f7884b 100644 ---- a/nix/nix.go -+++ b/nix/nix.go -@@ -49,6 +49,7 @@ type Deployment struct { - type NixContext struct { - EvalMachines string - ShowTrace bool -+ DryRun bool - KeepGCRoot bool - AllowBuildShell bool - } -@@ -269,6 +270,10 @@ func (ctx *NixContext) BuildMachines(deploymentPath string, hosts []Host, nixArg - args = append(args, "--show-trace") - } - -+ if ctx.DryRun { -+ args = append(args, "--dry-run") -+ } -+ - if nixBuildTargets != "" { - args = append(args, - "--arg", "buildTargets", nixBuildTargets) -@@ -308,6 +313,10 @@ func (ctx *NixContext) BuildMachines(deploymentPath string, hosts []Host, nixArg - return resultPath, errors.New(errorMessage) - } - -+ if ctx.DryRun { -+ return "", err -+ } -+ - resultPath, err = os.Readlink(resultLinkPath) - if err != nil { - return "", err diff --git a/overlays/morph/verbose_nix.patch b/overlays/morph/verbose_nix.patch deleted file mode 100644 index 389a79c..0000000 --- a/overlays/morph/verbose_nix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/nix/nix.go b/nix/nix.go -index bb63870..7fe04aa 100644 ---- a/nix/nix.go -+++ b/nix/nix.go -@@ -347,6 +347,7 @@ func Push(ctx *ssh.SSHContext, host Host, paths ...string) (err error) { - options := mkOptions(host) - for _, path := range paths { - args := []string{ -+ "-v", - "copy", - path, - "--to", "ssh://" + userArg + host.TargetHost + keyArg, diff --git a/overlays/neomutt/default.nix b/overlays/neomutt/default.nix deleted file mode 100644 index f03290a..0000000 --- a/overlays/neomutt/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - neomutt = super.neomutt.overrideAttrs(old: { - patches = old.patches or [] ++ [ - ./tx.patch - ]; - }); -} diff --git a/overlays/neomutt/tx.patch b/overlays/neomutt/tx.patch deleted file mode 100644 index c8736df..0000000 --- a/overlays/neomutt/tx.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit 61ae454e1579d02736c48e3468a3237429214cdf -Author: Ismaël Bouya -Date: Tue Jun 2 13:03:04 2020 +0200 - - Add %tx to index_format - -diff --git a/hdrline.c b/hdrline.c -index 9224c6641..1594ed729 100644 ---- a/hdrline.c -+++ b/hdrline.c -@@ -575,6 +575,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co - const struct Address *from = TAILQ_FIRST(&e->env->from); - const struct Address *to = TAILQ_FIRST(&e->env->to); - const struct Address *cc = TAILQ_FIRST(&e->env->cc); -+ const struct Address *x_orig_to = TAILQ_FIRST(&e->env->x_original_to); - - buf[0] = '\0'; - switch (op) -@@ -1192,13 +1193,18 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co - - case 't': - tmp[0] = '\0'; -- if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) && -- !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp))) -- { -- if (to) -- snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to)); -- else if (cc) -- snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc)); -+ if (src[0] == 'x') { -+ snprintf(tmp, sizeof(tmp), "%s", mutt_get_name(x_orig_to)); -+ src++; -+ } else { -+ if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) && -+ !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp))) -+ { -+ if (to) -+ snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to)); -+ else if (cc) -+ snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc)); -+ } - } - mutt_format_s(buf, buflen, prec, tmp); - break; diff --git a/overlays/nix-direnv/default.nix b/overlays/nix-direnv/default.nix deleted file mode 100644 index c4c96e2..0000000 --- a/overlays/nix-direnv/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - nix-direnv = super.nix-direnv.overrideAttrs (old: { - postPatch = old.postPatch + '' - sed -i -e 's/TEMPDIR "$old_tmp"/TEMPDIR "$old_tmpdir"/' direnvrc - ''; - }); -} diff --git a/overlays/nixops/default.nix b/overlays/nixops/default.nix deleted file mode 100644 index 14aec3b..0000000 --- a/overlays/nixops/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: super: { - nixops = super.nixops.overrideAttrs (old: { - patches = [ - ./fix_glibc.patch - (self.fetchpatch { - name = "hetzner_cloud.patch"; - url = "https://github.com/goodraven/nixops/commit/272e50d0b0262e49cdcaad42cdab57aad183d1c2.patch"; - sha256 = "12wcrb0155ald52m7fbr2m5rrxdnwdwripq91ckscgsk42mdc517"; - }) - ]; - preConfigure = (old.preConfigure or "") + '' - # https://github.com/NixOS/nixops/issues/1216 - sed -i -e "/Register the paths in the Nix database./s/#.*$/export USER=root/" nix/libvirtd-image.nix - - sed -i -e '/^import sys$/s/$/; sys.tracebacklimit = 0/' scripts/nixops - sed -i -e "/'keyFile'/s/'path'/'string'/" nixops/backends/__init__.py - sed -i -e "/security.initialRootPassword/d" nix/hetzner.nix - ''; - }); -} diff --git a/overlays/nixops/fix_glibc.patch b/overlays/nixops/fix_glibc.patch deleted file mode 100644 index 1aeb093..0000000 --- a/overlays/nixops/fix_glibc.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/nix/hetzner-bootstrap.nix b/nix/hetzner-bootstrap.nix -index 035e6f9..def42a1 100644 ---- a/nix/hetzner-bootstrap.nix -+++ b/nix/hetzner-bootstrap.nix -@@ -3,9 +3,7 @@ with import { system = "x86_64-linux"; }; - let - pkgsNative = import {}; - -- nixpart = python2Packages.nixpart0.override { -- useNixUdev = false; -- }; -+ nixpart = python2Packages.nixpart0; - - generateConfig = (import { - configuration = {}; diff --git a/overlays/nixops/hetzner_cloud.patch b/overlays/nixops/hetzner_cloud.patch deleted file mode 100644 index b75c116..0000000 --- a/overlays/nixops/hetzner_cloud.patch +++ /dev/null @@ -1,480 +0,0 @@ -From 272e50d0b0262e49cdcaad42cdab57aad183d1c2 Mon Sep 17 00:00:00 2001 -From: goodraven - -Date: Thu, 3 May 2018 22:24:58 -0700 -Subject: [PATCH] Initial commit adding support for hetzner cloud - -This is based on the digital ocean backend. It also uses nixos-infect. I extended nixos-infect to be generic -for both backends. - -Fixes #855 ---- - examples/trivial-hetzner-cloud.nix | 12 ++ - nix/eval-machine-info.nix | 1 + - nix/hetzner-cloud.nix | 56 +++++++ - nix/options.nix | 1 + - nixops/backends/hetzner_cloud.py | 230 +++++++++++++++++++++++++++++ - nixops/data/nixos-infect | 77 +++++++--- - 6 files changed, 354 insertions(+), 23 deletions(-) - create mode 100644 examples/trivial-hetzner-cloud.nix - create mode 100644 nix/hetzner-cloud.nix - create mode 100644 nixops/backends/hetzner_cloud.py - -diff --git a/examples/trivial-hetzner-cloud.nix b/examples/trivial-hetzner-cloud.nix -new file mode 100644 -index 000000000..c61add6bb ---- /dev/null -+++ b/examples/trivial-hetzner-cloud.nix -@@ -0,0 +1,12 @@ -+{ -+ resources.sshKeyPairs.ssh-key = {}; -+ -+ machine = { config, pkgs, ... }: { -+ services.openssh.enable = true; -+ -+ deployment.targetEnv = "hetznerCloud"; -+ deployment.hetznerCloud.serverType = "cx11"; -+ -+ networking.firewall.allowedTCPPorts = [ 22 ]; -+ }; -+} -diff --git a/nix/eval-machine-info.nix b/nix/eval-machine-info.nix -index 2884b4b47..6a7205786 100644 ---- a/nix/eval-machine-info.nix -+++ b/nix/eval-machine-info.nix -@@ -309,6 +309,7 @@ rec { - digitalOcean = optionalAttrs (v.config.deployment.targetEnv == "digitalOcean") v.config.deployment.digitalOcean; - gce = optionalAttrs (v.config.deployment.targetEnv == "gce") v.config.deployment.gce; - hetzner = optionalAttrs (v.config.deployment.targetEnv == "hetzner") v.config.deployment.hetzner; -+ hetznerCloud = optionalAttrs (v.config.deployment.targetEnv == "hetznerCloud") v.config.deployment.hetznerCloud; - container = optionalAttrs (v.config.deployment.targetEnv == "container") v.config.deployment.container; - route53 = v.config.deployment.route53; - virtualbox = -diff --git a/nix/hetzner-cloud.nix b/nix/hetzner-cloud.nix -new file mode 100644 -index 000000000..21d148c1a ---- /dev/null -+++ b/nix/hetzner-cloud.nix -@@ -0,0 +1,56 @@ -+{ config, pkgs, lib, utils, ... }: -+ -+with utils; -+with lib; -+with import ./lib.nix lib; -+ -+let -+ cfg = config.deployment.hetznerCloud; -+in -+{ -+ ###### interface -+ options = { -+ -+ deployment.hetznerCloud.authToken = mkOption { -+ default = ""; -+ example = "8b2f4e96af3997853bfd4cd8998958eab871d9614e35d63fab45a5ddf981c4da"; -+ type = types.str; -+ description = '' -+ The API auth token. We're checking the environment for -+ HETZNER_CLOUD_AUTH_TOKEN first and if that is -+ not set we try this auth token. -+ ''; -+ }; -+ -+ deployment.hetznerCloud.datacenter = mkOption { -+ example = "fsn1-dc8"; -+ default = null; -+ type = types.nullOr types.str; -+ description = '' -+ The datacenter. -+ ''; -+ }; -+ -+ deployment.hetznerCloud.location = mkOption { -+ example = "fsn1"; -+ default = null; -+ type = types.nullOr types.str; -+ description = '' -+ The location. -+ ''; -+ }; -+ -+ deployment.hetznerCloud.serverType = mkOption { -+ example = "cx11"; -+ type = types.str; -+ description = '' -+ Name or id of server types. -+ ''; -+ }; -+ }; -+ -+ config = mkIf (config.deployment.targetEnv == "hetznerCloud") { -+ nixpkgs.system = mkOverride 900 "x86_64-linux"; -+ services.openssh.enable = true; -+ }; -+} -diff --git a/nix/options.nix b/nix/options.nix -index 0866c3ab8..db021f74d 100644 ---- a/nix/options.nix -+++ b/nix/options.nix -@@ -22,6 +22,7 @@ in - ./keys.nix - ./gce.nix - ./hetzner.nix -+ ./hetzner-cloud.nix - ./container.nix - ./libvirtd.nix - ]; -diff --git a/nixops/backends/hetzner_cloud.py b/nixops/backends/hetzner_cloud.py -new file mode 100644 -index 000000000..a2cb176b9 ---- /dev/null -+++ b/nixops/backends/hetzner_cloud.py -@@ -0,0 +1,230 @@ -+# -*- coding: utf-8 -*- -+""" -+A backend for hetzner cloud. -+ -+This backend uses nixos-infect (which uses nixos LUSTRATE) to infect a -+hetzner cloud instance. The setup requires two reboots, one for -+the infect itself, another after we pushed the nixos image. -+""" -+import os -+import os.path -+import time -+import socket -+ -+import requests -+ -+import nixops.resources -+from nixops.backends import MachineDefinition, MachineState -+from nixops.nix_expr import Function, RawValue -+import nixops.util -+import nixops.known_hosts -+ -+infect_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data', 'nixos-infect')) -+ -+API_HOST = 'api.hetzner.cloud' -+ -+class ApiError(Exception): -+ pass -+ -+class ApiNotFoundError(ApiError): -+ pass -+ -+class HetznerCloudDefinition(MachineDefinition): -+ @classmethod -+ def get_type(cls): -+ return "hetznerCloud" -+ -+ def __init__(self, xml, config): -+ MachineDefinition.__init__(self, xml, config) -+ self.auth_token = config["hetznerCloud"]["authToken"] -+ self.location = config["hetznerCloud"]["location"] -+ self.datacenter = config["hetznerCloud"]["datacenter"] -+ self.server_type = config["hetznerCloud"]["serverType"] -+ -+ def show_type(self): -+ return "{0} [{1}]".format(self.get_type(), self.location or self.datacenter or 'any location') -+ -+ -+class HetznerCloudState(MachineState): -+ @classmethod -+ def get_type(cls): -+ return "hetznerCloud" -+ -+ state = nixops.util.attr_property("state", MachineState.MISSING, int) # override -+ public_ipv4 = nixops.util.attr_property("publicIpv4", None) -+ public_ipv6 = nixops.util.attr_property("publicIpv6", None) -+ location = nixops.util.attr_property("hetznerCloud.location", None) -+ datacenter = nixops.util.attr_property("hetznerCloud.datacenter", None) -+ server_type = nixops.util.attr_property("hetznerCloud.serverType", None) -+ auth_token = nixops.util.attr_property("hetznerCloud.authToken", None) -+ server_id = nixops.util.attr_property("hetznerCloud.serverId", None, int) -+ -+ def __init__(self, depl, name, id): -+ MachineState.__init__(self, depl, name, id) -+ self.name = name -+ -+ def get_ssh_name(self): -+ return self.public_ipv4 -+ -+ def get_ssh_flags(self, *args, **kwargs): -+ super_flags = super(HetznerCloudState, self).get_ssh_flags(*args, **kwargs) -+ return super_flags + [ -+ '-o', 'UserKnownHostsFile=/dev/null', -+ '-o', 'StrictHostKeyChecking=no', -+ '-i', self.get_ssh_private_key_file(), -+ ] -+ -+ def get_physical_spec(self): -+ return Function("{ ... }", { -+ 'imports': [ RawValue('') ], -+ ('boot', 'loader', 'grub', 'device'): 'nodev', -+ ('fileSystems', '/'): { 'device': '/dev/sda1', 'fsType': 'ext4'}, -+ ('users', 'extraUsers', 'root', 'openssh', 'authorizedKeys', 'keys'): [self.depl.active_resources.get('ssh-key').public_key], -+ }) -+ -+ def get_ssh_private_key_file(self): -+ return self.write_ssh_private_key(self.depl.active_resources.get('ssh-key').private_key) -+ -+ def create_after(self, resources, defn): -+ # make sure the ssh key exists before we do anything else -+ return { -+ r for r in resources if -+ isinstance(r, nixops.resources.ssh_keypair.SSHKeyPairState) -+ } -+ -+ def get_auth_token(self): -+ return os.environ.get('HETZNER_CLOUD_AUTH_TOKEN', self.auth_token) -+ -+ def _api(self, path, method=None, data=None, json=True): -+ """Basic wrapper around requests that handles auth and serialization.""" -+ assert path[0] == '/' -+ url = 'https://%s%s' % (API_HOST, path) -+ token = self.get_auth_token() -+ if not token: -+ raise Exception('No hetzner cloud auth token set') -+ headers = { -+ 'Authorization': 'Bearer '+self.get_auth_token(), -+ } -+ res = requests.request( -+ method=method, -+ url=url, -+ json=data, -+ headers=headers) -+ -+ if res.status_code == 404: -+ raise ApiNotFoundError('Not Found: %r' % path) -+ elif not res.ok: -+ raise ApiError('Response for %s %s has status code %d: %s' % (method, path, res.status_code, res.content)) -+ if not json: -+ return -+ try: -+ res_data = res.json() -+ except ValueError as e: -+ raise ApiError('Response for %s %s has invalid JSON (%s): %r' % (method, path, e, res.content)) -+ return res_data -+ -+ -+ def destroy(self, wipe=False): -+ if not self.server_id: -+ self.log('server {} was never made'.format(self.name)) -+ return -+ self.log('destroying server {} with id {}'.format(self.name, self.server_id)) -+ try: -+ res = self._api('/v1/servers/%s' % (self.server_id), method='DELETE') -+ except ApiNotFoundError: -+ self.log("server not found - assuming it's been destroyed already") -+ -+ self.public_ipv4 = None -+ self.server_id = None -+ -+ return True -+ -+ def _create_ssh_key(self, public_key): -+ """Create or get an ssh key and return an id.""" -+ public_key = public_key.strip() -+ res = self._api('/v1/ssh_keys', method='GET') -+ name = 'nixops-%s-%s' % (self.depl.uuid, self.name) -+ deletes = [] -+ for key in res['ssh_keys']: -+ if key['public_key'].strip() == public_key: -+ return key['id'] -+ if key['name'] == name: -+ deletes.append(key['id']) -+ for d in deletes: -+ # This reply is empty, so don't decode json. -+ self._api('/v1/ssh_keys/%d' % d, method='DELETE', json=False) -+ res = self._api('/v1/ssh_keys', method='POST', data={ -+ 'name': name, -+ 'public_key': public_key, -+ }) -+ return res['ssh_key']['id'] -+ -+ def create(self, defn, check, allow_reboot, allow_recreate): -+ ssh_key = self.depl.active_resources.get('ssh-key') -+ if ssh_key is None: -+ raise Exception('Please specify a ssh-key resource (resources.sshKeyPairs.ssh-key = {}).') -+ -+ self.set_common_state(defn) -+ -+ if self.server_id is not None: -+ return -+ -+ ssh_key_id = self._create_ssh_key(ssh_key.public_key) -+ -+ req = { -+ 'name': self.name, -+ 'server_type': defn.server_type, -+ 'start_after_create': True, -+ 'image': 'debian-9', -+ 'ssh_keys': [ -+ ssh_key_id, -+ ], -+ } -+ -+ if defn.datacenter: -+ req['datacenter'] = defn.datacenter -+ elif defn.location: -+ req['location'] = defn.location -+ -+ self.log_start("creating server ...") -+ create_res = self._api('/v1/servers', method='POST', data=req) -+ self.server_id = create_res['server']['id'] -+ self.public_ipv4 = create_res['server']['public_net']['ipv4']['ip'] -+ self.public_ipv6 = create_res['server']['public_net']['ipv6']['ip'] -+ self.datacenter = create_res['server']['datacenter']['name'] -+ self.location = create_res['server']['datacenter']['location']['name'] -+ -+ action = create_res['action'] -+ action_path = '/v1/servers/%d/actions/%d' % (self.server_id, action['id']) -+ -+ while action['status'] == 'running': -+ time.sleep(1) -+ res = self._api(action_path, method='GET') -+ action = res['action'] -+ -+ if action['status'] != 'success': -+ raise Exception('unexpected status: %s' % action['status']) -+ -+ self.log_end("{}".format(self.public_ipv4)) -+ -+ self.wait_for_ssh() -+ self.log_start("running nixos-infect") -+ self.run_command('bash &1', stdin=open(infect_path)) -+ self.reboot_sync() -+ -+ def reboot(self, hard=False): -+ if hard: -+ self.log("sending hard reset to server...") -+ res = self._api('/v1/servers/%d/actions/reset' % self.server_id, method='POST') -+ action = res['action'] -+ action_path = '/v1/servers/%d/actions/%d' % (self.server_id, action['id']) -+ while action['status'] == 'running': -+ time.sleep(1) -+ res = self._api(action_path, method='GET') -+ action = res['action'] -+ if action['status'] != 'success': -+ raise Exception('unexpected status: %s' % action['status']) -+ self.wait_for_ssh() -+ self.state = self.STARTING -+ else: -+ MachineState.reboot(self, hard=hard) -diff --git a/nixops/data/nixos-infect b/nixops/data/nixos-infect -index 66634357b..437a2ec61 100644 ---- a/nixops/data/nixos-infect -+++ b/nixops/data/nixos-infect -@@ -68,26 +68,49 @@ makeConf() { - } - EOF - # (nixos-generate-config will add qemu-user and bind-mounts, so avoid) -+ local disk -+ if [ -e /dev/sda ]; then -+ disk=/dev/sda -+ else -+ disk=/dev/vda -+ fi - cat > /etc/nixos/hardware-configuration.nix << EOF - { ... }: - { - imports = [ ]; -- boot.loader.grub.device = "/dev/vda"; -- fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; }; -+ boot.loader.grub.device = "${disk}"; -+ fileSystems."/" = { device = "${disk}1"; fsType = "ext4"; }; - } - EOF - - local IFS=$'\n' -- ens3_ip4s=($(ip address show dev eth0 | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -- ens3_ip6s=($(ip address show dev eth0 | grep 'inet6 .*global' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -- ens4_ip4s=($(ip address show dev eth1 | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -- ens4_ip6s=($(ip address show dev eth1 | grep 'inet6 .*global' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -- gateway=($(ip route show dev eth0 | grep default | sed -r 's|default via ([0-9.]+).*|\1|')) -- gateway6=($(ip -6 route show dev eth0 | grep default | sed -r 's|default via ([0-9a-f:]+).*|\1|')) -- ether0=($(ip address show dev eth0 | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')) -- ether1=($(ip address show dev eth1 | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')) -+ gateway=($(ip route show | grep default | sed -r 's|default via ([0-9.]+).*|\1|')) -+ gateway6=($(ip -6 route show | grep default | sed -r 's|default via ([0-9a-f:]+).*|\1|')) -+ interfaces=($(ip link | awk -F ': ' '/^[0-9]*: / {if ($2 != "lo") {print $2}}')) - nameservers=($(grep ^nameserver /etc/resolv.conf | cut -f2 -d' ')) - -+ # Predict the predictable name for each interface since that is enabled in -+ # the nixos system. -+ declare -A predictable_names -+ for interface in ${interfaces[@]}; do -+ # udevadm prints out the candidate names which will be selected if -+ # available in this order. -+ local name=$(udevadm info /sys/class/net/$interface | awk -F = ' -+ /^E: ID_NET_NAME_FROM_DATABASE=/ {arr[1]=$2} -+ /^E: ID_NET_NAME_ONBOARD=/ {arr[2]=$2} -+ /^E: ID_NET_NAME_SLOT=/ {arr[3]=$2} -+ /^E: ID_NET_NAME_PATH=/ {arr[4]=$2} -+ /^E: ID_NET_NAME_MAC=/ {arr[5]=$2} -+ END {for (i=1;i<6;i++) {if (length(arr[i]) > 0) { print arr[i]; break}}}') -+ if [ -z "$name" ]; then -+ echo Could not determine predictable name for interface $interface -+ fi -+ predictable_names[$interface]=$name -+ done -+ -+ # Take a gamble on the first interface being able to reach the gateway. -+ local default_interface=${predictable_names[${interfaces[0]}]} -+ - cat > /etc/nixos/networking.nix << EOF - { ... }: { - # This file was populated at runtime with the networking -@@ -96,25 +119,27 @@ EOF - nameservers = [$(for a in ${nameservers[@]}; do echo -n " - \"$a\""; done) - ]; -- defaultGateway = "${gateway}"; -- defaultGateway6 = "${gateway6}"; -+ defaultGateway = {address = "${gateway}"; interface = "${default_interface}";}; -+ defaultGateway6 = {address = "${gateway6}"; interface = "${default_interface}";}; - interfaces = { -- ens3 = { -- ip4 = [$(for a in ${ens3_ip4s[@]}; do echo -n " -- $a"; done) -- ]; -- ip6 = [$(for a in ${ens3_ip6s[@]}; do echo -n " -- $a"; done) -- ]; -- }; -- ens4 = { -- ip4 = [$(for a in ${ens4_ip4s[@]}; do echo -n " -+EOF -+ -+ for interface in ${interfaces[@]}; do -+ ip4s=($(ip address show dev $interface | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -+ ip6s=($(ip address show dev $interface | grep 'inet6 .*global' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')) -+ cat >> /etc/nixos/networking.nix << EOF -+ ${predictable_names[$interface]} = { -+ ip4 = [$(for a in ${ip4s[@]}; do echo -n " - $a"; done) - ]; -- ip6 = [$(for a in ${ens4_ip6s[@]}; do echo -n " -+ ip6 = [$(for a in ${ip6s[@]}; do echo -n " - $a"; done) - ]; - }; -+EOF -+ done -+ -+ cat >> /etc/nixos/networking.nix << EOF - }; - }; - } -@@ -154,6 +179,12 @@ export HOME="/root" - groupadd -r nixbld -g 30000 - seq 1 10 | xargs -I{} useradd -c "Nix build user {}" -d /var/empty -g nixbld -G nixbld -M -N -r -s `which nologin` nixbld{} - -+if ! which curl >/dev/null 2>/dev/null; then -+ if which apt-get >/dev/null 2>/dev/null; then -+ apt-get update && apt-get install -y curl -+ fi -+fi -+ - curl https://nixos.org/nix/install | sh - - source ~/.nix-profile/etc/profile.d/nix.sh diff --git a/overlays/pass/default.nix b/overlays/pass/default.nix deleted file mode 100644 index ad8facd..0000000 --- a/overlays/pass/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - pass = super.pass.overrideAttrs (old: rec { - patches = old.patches ++ [ ./pass-fix-pass-init.patch ]; - }); -} diff --git a/overlays/pass/pass-fix-pass-init.patch b/overlays/pass/pass-fix-pass-init.patch deleted file mode 100644 index 10a76c1..0000000 --- a/overlays/pass/pass-fix-pass-init.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 33e8f1cd0065639a948d7b5ba3f93d43bdf7f3be Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= -Date: Sun, 11 Nov 2018 19:47:33 +0100 -Subject: [PATCH] Fix pass init for some gpg keys - -This fixes the pass init for gpg keys which have their main key as -encryption key. This may happen for instance with RSA keys and specific -configuration. ---- - src/password-store.sh | 2 +- - tests/t0300-reencryption.sh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/password-store.sh b/src/password-store.sh -index d89d455..44d122e 100755 ---- a/src/password-store.sh -+++ b/src/password-store.sh -@@ -124,7 +124,7 @@ reencrypt_path() { - IFS=";" eval 'GPG_RECIPIENTS+=( $group )' # http://unix.stackexchange.com/a/92190 - unset "GPG_RECIPIENTS[$index]" - done -- gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" -+ gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" - fi - current_keys="$(LC_ALL=C $GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\+\)$/\1/p' | LC_ALL=C sort -u)" - -diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh -index 3c88987..57d873f 100755 ---- a/tests/t0300-reencryption.sh -+++ b/tests/t0300-reencryption.sh -@@ -7,7 +7,7 @@ cd "$(dirname "$0")" - INITIAL_PASSWORD="will this password live? a big question indeed..." - - canonicalize_gpg_keys() { -- $GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u -+ $GPG --list-keys --with-colons "$@" | sed -n 's/[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u - } - gpg_keys_from_encrypted_file() { - $GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | grep "public key is" | cut -d ' ' -f 5 | LC_ALL=C sort -u --- -2.19.1 - diff --git a/overlays/pelican/default.nix b/overlays/pelican/default.nix deleted file mode 100644 index 4f8aece..0000000 --- a/overlays/pelican/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - pelican = with self.python3Packages; - pelican.overrideAttrs(old: { - propagatedBuildInputs = old.propagatedBuildInputs ++ [ pyyaml markdown ]; - doInstallCheck = false; - }); -} diff --git a/overlays/php-packages/default.nix b/overlays/php-packages/default.nix deleted file mode 100644 index 90fb613..0000000 --- a/overlays/php-packages/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -self: super: rec { - myPhpPackages.mysqli_pam = self.php74.extensions.mysqli.overrideAttrs(old: { - configureFlags = [ "--with-mysqli=${self.libmysqlclient_pam}/bin/mysql_config" "--with-mysql-sock=/run/mysqld/mysqld.sock" ]; - patches = old.patches or [] ++ [ ./mysqli_patch.patch ]; -}); -} diff --git a/overlays/php-packages/mysqli_patch.patch b/overlays/php-packages/mysqli_patch.patch deleted file mode 100644 index a8f03e3..0000000 --- a/overlays/php-packages/mysqli_patch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/ext/mysqli/mysqli_nonapi.c -+++ b/ext/mysqli/mysqli_nonapi.c -@@ -263,7 +263,7 @@ void mysqli_common_connect(INTERNAL_FUNC - php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql)); - - #if !defined(MYSQLI_USE_MYSQLND) -- mysql->mysql->reconnect = MyG(reconnect); -+ mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect)); - #endif - - mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile)); diff --git a/overlays/postfix/default.nix b/overlays/postfix/default.nix deleted file mode 100644 index c77e4cf..0000000 --- a/overlays/postfix/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -self: super: { - postfix = super.postfix.override { withMySQL = true; withPgSQL = true; }; -} diff --git a/overlays/procps-ng/default.nix b/overlays/procps-ng/default.nix deleted file mode 100644 index 2d43a11..0000000 --- a/overlays/procps-ng/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - procps-ng = super.procps-ng.overrideAttrs(old: { - configureFlags = old.configureFlags ++ [ "--enable-watch8bit" ]; - }); -} diff --git a/overlays/python-packages/buildbot.nix b/overlays/python-packages/buildbot.nix deleted file mode 100644 index ccf2f6a..0000000 --- a/overlays/python-packages/buildbot.nix +++ /dev/null @@ -1,8 +0,0 @@ -self: super: { - pythonOverrides = self.buildPythonOverrides (pyself: pysuper: { - buildbot-plugins = pysuper.buildbot-plugins // { - buildslist = self.python3PackagesPlus.buildbot-plugins.buildslist; - }; - buildbot-full = pysuper.buildbot-full.withPlugins [ pyself.buildbot-plugins.buildslist ]; - }) super.pythonOverrides; -} diff --git a/overlays/python-packages/default.nix b/overlays/python-packages/default.nix deleted file mode 100644 index 601eed1..0000000 --- a/overlays/python-packages/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -let - fromMyPythonPackages = name: self: super: { - pythonOverrides = self.buildPythonOverrides (pyself: pysuper: { - "${name}" = self."${pyself.python.pname}PackagesPlus"."${name}"; - }) super.pythonOverrides; - }; -in -{ - # https://github.com/NixOS/nixpkgs/issues/44426 - # needs to come before all other in alphabetical order (or make use of - # lib.mkBefore) - __pythonOverlayFix = self: super: let - pyNames = [ "python3" "python36" "python37" "python38" ]; - overriddenPython = name: [ - { inherit name; value = super.${name}.override { packageOverrides = self.pythonOverrides; }; } - { name = "${name}Packages"; value = self.recurseIntoAttrs self.${name}.pkgs; } - ]; - overriddenPythons = builtins.concatLists (map overriddenPython pyNames); - in { - pythonOverrides = pyself: pysuper: {}; - buildPythonOverrides = newOverrides: currentOverrides: super.lib.composeExtensions newOverrides currentOverrides; - } // super.lib.attrsets.listToAttrs overriddenPythons; - - - blivet3 = fromMyPythonPackages "blivet3"; - buildbot = import ./buildbot.nix; - wokkel = fromMyPythonPackages "wokkel"; - pymilter = fromMyPythonPackages "pymilter"; -} diff --git a/overlays/sc-im/default.nix b/overlays/sc-im/default.nix deleted file mode 100644 index f728655..0000000 --- a/overlays/sc-im/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -self: super: { - sc-im = super.sc-im.overrideAttrs (old: { - buildPhase = '' - cd src - sed -i Makefile -e 's@\...name.info@.local/state/$(name)info@' - cd .. - '' + old.buildPhase; - }); -} diff --git a/overlays/shaarli/default.nix b/overlays/shaarli/default.nix deleted file mode 100644 index 3b37ee8..0000000 --- a/overlays/shaarli/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -self: super: { - shaarli = varDir: super.shaarli.overrideAttrs (old: rec { - version = "0.10.2"; - src = self.fetchurl { - url = "https://github.com/shaarli/Shaarli/releases/download/v${version}/shaarli-v${version}-full.tar.gz"; - sha256 = "0h8sspj7siy3vgpi2i3gdrjcr5935fr4dfwq2zwd70sjx2sh9s78"; - }; - patchPhase = ""; - patches = (old.patches or []) ++ [ ./shaarli_ldap.patch ]; - installPhase = (old.installPhase or "") + '' - cp .htaccess $out/ - ln -sf ${varDir}/{cache,pagecache,tmp,data} $out/ - ''; - }); -} diff --git a/overlays/shaarli/shaarli_ldap.patch b/overlays/shaarli/shaarli_ldap.patch deleted file mode 100644 index e66a54f..0000000 --- a/overlays/shaarli/shaarli_ldap.patch +++ /dev/null @@ -1,425 +0,0 @@ -commit a19c24edc1057bd411821f9e3e7d1d309d38b1bb -Author: Ismaël Bouya -Date: Sun Feb 3 20:58:18 2019 +0100 - - Add ldap connection - -diff --git a/.htaccess b/.htaccess -index 4c00427..5acd708 100644 ---- a/.htaccess -+++ b/.htaccess -@@ -6,10 +6,23 @@ RewriteEngine On - # Prevent accessing subdirectories not managed by SCM - RewriteRule ^(.git|doxygen|vendor) - [F] - -+RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ -+RewriteRule ^(.*) - [E=BASE:%1] -+ -+RewriteCond %{ENV:REDIRECT_BASE} (.+) -+RewriteRule .* - [E=BASE:%1] -+ - # Forward the "Authorization" HTTP header - RewriteCond %{HTTP:Authorization} ^(.*) - RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] - -+RewriteCond %{REQUEST_FILENAME} !-f -+RewriteCond %{REQUEST_FILENAME} !-d -+RewriteRule ^((?!api/)[^/]*)/?(.*)$ $2?%{QUERY_STRING} [E=USERSPACE:$1] -+ -+RewriteCond %{ENV:REDIRECT_USERSPACE} (.+) -+RewriteRule .* - [E=USERSPACE:%1] -+ - # REST API - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d -diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php -index 911873a..f21a1ef 100644 ---- a/application/ApplicationUtils.php -+++ b/application/ApplicationUtils.php -@@ -191,6 +191,9 @@ public static function checkResourcePermissions($conf) - $conf->get('resource.page_cache'), - $conf->get('resource.raintpl_tmp'), - ) as $path) { -+ if (! is_dir($path)) { -+ mkdir($path, 0755, true); -+ } - if (! is_readable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('directory is not readable'); - } -diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php -index 32aaea4..99efc15 100644 ---- a/application/config/ConfigManager.php -+++ b/application/config/ConfigManager.php -@@ -21,6 +21,11 @@ class ConfigManager - - public static $DEFAULT_PLUGINS = array('qrcode'); - -+ /** -+ * @var string User space. -+ */ -+ protected $userSpace; -+ - /** - * @var string Config folder. - */ -@@ -41,12 +46,36 @@ class ConfigManager - * - * @param string $configFile Configuration file path without extension. - */ -- public function __construct($configFile = 'data/config') -+ public function __construct($configFile = null, $userSpace = null) - { -- $this->configFile = $configFile; -+ $this->userSpace = $this->findLDAPUser($userSpace); -+ if ($configFile !== null) { -+ $this->configFile = $configFile; -+ } else { -+ $this->configFile = ($this->userSpace === null) ? 'data/config' : 'data/' . $this->userSpace . '/config'; -+ } - $this->initialize(); - } - -+ public function findLDAPUser($login, $password = null) { -+ $connect = ldap_connect(getenv('SHAARLI_LDAP_HOST')); -+ ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); -+ if (!$connect || !ldap_bind($connect, getenv('SHAARLI_LDAP_DN'), getenv('SHAARLI_LDAP_PASSWORD'))) { -+ return false; -+ } -+ -+ $search_query = str_replace('%login%', ldap_escape($login), getenv('SHAARLI_LDAP_FILTER')); -+ -+ $search = ldap_search($connect, getenv('SHAARLI_LDAP_BASE'), $search_query); -+ $info = ldap_get_entries($connect, $search); -+ -+ if (ldap_count_entries($connect, $search) == 1 && (is_null($password) || ldap_bind($connect, $info[0]["dn"], $password))) { -+ return $login; -+ } else { -+ return null; -+ } -+ } -+ - /** - * Reset the ConfigManager instance. - */ -@@ -269,6 +298,16 @@ public function getConfigFileExt() - return $this->configFile . $this->configIO->getExtension(); - } - -+ /** -+ * Get the current userspace. -+ * -+ * @return mixed User space. -+ */ -+ public function getUserSpace() -+ { -+ return $this->userSpace; -+ } -+ - /** - * Recursive function which find asked setting in the loaded config. - * -@@ -342,19 +381,31 @@ protected static function removeConfig($settings, &$conf) - */ - protected function setDefaultValues() - { -- $this->setEmpty('resource.data_dir', 'data'); -- $this->setEmpty('resource.config', 'data/config.php'); -- $this->setEmpty('resource.datastore', 'data/datastore.php'); -- $this->setEmpty('resource.ban_file', 'data/ipbans.php'); -- $this->setEmpty('resource.updates', 'data/updates.txt'); -- $this->setEmpty('resource.log', 'data/log.txt'); -- $this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt'); -- $this->setEmpty('resource.history', 'data/history.php'); -+ if ($this->userSpace === null) { -+ $data = 'data'; -+ $tmp = 'tmp'; -+ $cache = 'cache'; -+ $pagecache = 'pagecache'; -+ } else { -+ $data = 'data/' . ($this->userSpace); -+ $tmp = 'tmp/' . ($this->userSpace); -+ $cache = 'cache/' . ($this->userSpace); -+ $pagecache = 'pagecache/' . ($this->userSpace); -+ } -+ -+ $this->setEmpty('resource.data_dir', $data); -+ $this->setEmpty('resource.config', $data . '/config.php'); -+ $this->setEmpty('resource.datastore', $data . '/datastore.php'); -+ $this->setEmpty('resource.ban_file', $data . '/ipbans.php'); -+ $this->setEmpty('resource.updates', $data . '/updates.txt'); -+ $this->setEmpty('resource.log', $data . '/log.txt'); -+ $this->setEmpty('resource.update_check', $data . '/lastupdatecheck.txt'); -+ $this->setEmpty('resource.history', $data . '/history.php'); - $this->setEmpty('resource.raintpl_tpl', 'tpl/'); - $this->setEmpty('resource.theme', 'default'); -- $this->setEmpty('resource.raintpl_tmp', 'tmp/'); -- $this->setEmpty('resource.thumbnails_cache', 'cache'); -- $this->setEmpty('resource.page_cache', 'pagecache'); -+ $this->setEmpty('resource.raintpl_tmp', $tmp); -+ $this->setEmpty('resource.thumbnails_cache', $cache); -+ $this->setEmpty('resource.page_cache', $pagecache); - - $this->setEmpty('security.ban_after', 4); - $this->setEmpty('security.ban_duration', 1800); -diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php -index d6784d6..bdfaca7 100644 ---- a/application/security/LoginManager.php -+++ b/application/security/LoginManager.php -@@ -32,6 +32,9 @@ class LoginManager - /** @var string User sign-in token depending on remote IP and credentials */ - protected $staySignedInToken = ''; - -+ protected $lastErrorReason = ''; -+ protected $lastErrorIsBanishable = false; -+ - /** - * Constructor - * -@@ -83,7 +86,7 @@ public function getStaySignedInToken() - */ - public function checkLoginState($cookie, $clientIpId) - { -- if (! $this->configManager->exists('credentials.login')) { -+ if (! $this->configManager->exists('credentials.login') || (isset($_SESSION['username']) && $_SESSION['username'] && $this->configManager->get('credentials.login') !== $_SESSION['username'])) { - // Shaarli is not configured yet - $this->isLoggedIn = false; - return; -@@ -133,20 +136,40 @@ public function isLoggedIn() - */ - public function checkCredentials($remoteIp, $clientIpId, $login, $password) - { -- $hash = sha1($password . $login . $this->configManager->get('credentials.salt')); -+ $this->lastErrorIsBanishable = false; -+ -+ if ($this->configManager->getUserSpace() !== null && $this->configManager->getUserSpace() !== $login) { -+ logm($this->configManager->get('resource.log'), -+ $remoteIp, -+ 'Trying to login to wrong user space'); -+ $this->lastErrorReason = 'You’re trying to access the wrong account.'; -+ return false; -+ } - -- if ($login != $this->configManager->get('credentials.login') -- || $hash != $this->configManager->get('credentials.hash') -- ) { -+ logm($this->configManager->get('resource.log'), -+ $remoteIp, -+ 'Trying LDAP connection'); -+ $result = $this->configManager->findLDAPUser($login, $password); -+ if ($result === false) { - logm( - $this->configManager->get('resource.log'), - $remoteIp, -- 'Login failed for user ' . $login -+ 'Impossible to connect to LDAP' - ); -+ $this->lastErrorReason = 'Server error.'; -+ return false; -+ } else if (is_null($result)) { -+ logm( -+ $this->configManager->get('resource.log'), -+ $remoteIp, -+ 'Login failed for user ' . $login -+ ); -+ $this->lastErrorIsBanishable = true; -+ $this->lastErrorReason = 'Wrong login/password.'; - return false; - } - -- $this->sessionManager->storeLoginInfo($clientIpId); -+ $this->sessionManager->storeLoginInfo($clientIpId, $login); - logm( - $this->configManager->get('resource.log'), - $remoteIp, -@@ -187,6 +210,10 @@ protected function writeBanFile() - */ - public function handleFailedLogin($server) - { -+ if (!$this->lastErrorIsBanishable) { -+ return $this->lastErrorReason ?: 'Error during login.'; -+ }; -+ - $ip = $server['REMOTE_ADDR']; - $trusted = $this->configManager->get('security.trusted_proxies', []); - -@@ -215,6 +242,7 @@ public function handleFailedLogin($server) - ); - } - $this->writeBanFile(); -+ return $this->lastErrorReason ?: 'Error during login.'; - } - - /** -diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php -index b8b8ab8..5eb4aac 100644 ---- a/application/security/SessionManager.php -+++ b/application/security/SessionManager.php -@@ -111,10 +111,10 @@ public static function checkId($sessionId) - * - * @param string $clientIpId Client IP address identifier - */ -- public function storeLoginInfo($clientIpId) -+ public function storeLoginInfo($clientIpId, $login = null) - { - $this->session['ip'] = $clientIpId; -- $this->session['username'] = $this->conf->get('credentials.login'); -+ $this->session['username'] = $login ?: $this->conf->get('credentials.login'); - $this->extendTimeValidityBy(self::$SHORT_TIMEOUT); - } - -diff --git a/index.php b/index.php -index 4b86a3e..58ae2dd 100644 ---- a/index.php -+++ b/index.php -@@ -121,7 +121,32 @@ - $_COOKIE['shaarli'] = session_id(); - } - --$conf = new ConfigManager(); -+$folderBase = getenv("BASE"); -+ -+if (getenv("USERSPACE")) { -+ if (isset($_GET["do"]) && $_GET["do"] == "login") { -+ header("Location: $folderBase/?do=login"); -+ exit; -+ } -+ $userspace = preg_replace("/[^-_A-Za-z0-9]/", '', getenv("USERSPACE")); -+} else if (isset($_SESSION["username"]) && $_SESSION["username"]) { -+ header("Location: " . $folderBase . "/" . $_SESSION["username"] . "?"); -+ exit; -+} else if (!isset($_GET["do"]) || $_GET["do"] != "login") { -+ header("Location: $folderBase/?do=login"); -+ exit; -+} -+ -+if (!isset($userspace) && isset($_POST["login"])) { -+ $userspace = preg_replace("/[^-_A-Za-z0-9]/", '', $_POST["login"]); -+ error_log("debugImmae: setting userspace from POST: " . $userspace); -+} -+ -+if (isset($userspace)) { -+ $conf = new ConfigManager(null, $userspace); -+} else { -+ $conf = new ConfigManager(); -+} - $sessionManager = new SessionManager($_SESSION, $conf); - $loginManager = new LoginManager($GLOBALS, $conf, $sessionManager); - $loginManager->generateStaySignedInToken($_SERVER['REMOTE_ADDR']); -@@ -175,7 +200,7 @@ - } - - // Display the installation form if no existing config is found -- install($conf, $sessionManager, $loginManager); -+ install($conf, $sessionManager, $loginManager, $userspace); - } - - $loginManager->checkLoginState($_COOKIE, $clientIpId); -@@ -205,6 +230,7 @@ function isLoggedIn() - && $loginManager->checkCredentials($_SERVER['REMOTE_ADDR'], $clientIpId, $_POST['login'], $_POST['password']) - ) { - $loginManager->handleSuccessfulLogin($_SERVER); -+ $userspace = $_POST['login']; - - $cookiedir = ''; - if (dirname($_SERVER['SCRIPT_NAME']) != '/') { -@@ -241,25 +267,25 @@ function isLoggedIn() - $uri .= '&'.$param.'='.urlencode($_GET[$param]); - } - } -- header('Location: '. $uri); -+ header('Location: '. $userspace . $uri); - exit; - } - - if (isset($_GET['edit_link'])) { -- header('Location: ?edit_link='. escape($_GET['edit_link'])); -+ header('Location: ' . $userspace . '?edit_link='. escape($_GET['edit_link'])); - exit; - } - - if (isset($_POST['returnurl'])) { - // Prevent loops over login screen. - if (strpos($_POST['returnurl'], 'do=login') === false) { -- header('Location: '. generateLocation($_POST['returnurl'], $_SERVER['HTTP_HOST'])); -+ header('Location: ' . generateLocation($_POST['returnurl'], $_SERVER['HTTP_HOST'])); - exit; - } - } -- header('Location: ?'); exit; -+ header('Location: '. $userspace . '?'); exit; - } else { -- $loginManager->handleFailedLogin($_SERVER); -+ $errorReason = $loginManager->handleFailedLogin($_SERVER); - $redir = '&username='. urlencode($_POST['login']); - if (isset($_GET['post'])) { - $redir .= '&post=' . urlencode($_GET['post']); -@@ -270,7 +296,7 @@ function isLoggedIn() - } - } - // Redirect to login screen. -- echo ''; -+ echo ''; - exit; - } - } -@@ -1719,7 +1745,7 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager) - * @param SessionManager $sessionManager SessionManager instance - * @param LoginManager $loginManager LoginManager instance - */ --function install($conf, $sessionManager, $loginManager) { -+function install($conf, $sessionManager, $loginManager, $userspace) { - // On free.fr host, make sure the /sessions directory exists, otherwise login will not work. - if (endsWith($_SERVER['HTTP_HOST'],'.free.fr') && !is_dir($_SERVER['DOCUMENT_ROOT'].'/sessions')) mkdir($_SERVER['DOCUMENT_ROOT'].'/sessions',0705); - -@@ -1755,7 +1781,7 @@ function install($conf, $sessionManager, $loginManager) { - } - - -- if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) -+ if (true) - { - $tz = 'UTC'; - if (!empty($_POST['continent']) && !empty($_POST['city']) -@@ -1764,15 +1790,15 @@ function install($conf, $sessionManager, $loginManager) { - $tz = $_POST['continent'].'/'.$_POST['city']; - } - $conf->set('general.timezone', $tz); -- $login = $_POST['setlogin']; -- $conf->set('credentials.login', $login); -+ $conf->set('credentials.login', $userspace); - $salt = sha1(uniqid('', true) .'_'. mt_rand()); - $conf->set('credentials.salt', $salt); -- $conf->set('credentials.hash', sha1($_POST['setpassword'] . $login . $salt)); -+ $hash = sha1(uniqid('', true) .'_'. mt_rand()); -+ $conf->set('credentials.hash', $hash); - if (!empty($_POST['title'])) { - $conf->set('general.title', escape($_POST['title'])); - } else { -- $conf->set('general.title', 'Shared links on '.escape(index_url($_SERVER))); -+ $conf->set('general.title', ucwords(str_replace("_", " ", $userspace))); - } - $conf->set('translation.language', escape($_POST['language'])); - $conf->set('updates.check_updates', !empty($_POST['updateCheck'])); -@@ -1841,7 +1867,12 @@ function install($conf, $sessionManager, $loginManager) { - $app = new \Slim\App($container); - - // REST API routes --$app->group('/api/v1', function() { -+if (isset($userspace)) { -+ $mountpoint = '/' . $userspace . '/api/v1'; -+} else { -+ $mountpoint = '/api/v1'; -+} -+$app->group($mountpoint, function() { - $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo'); - $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks'); - $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink'); -@@ -1860,7 +1891,7 @@ function install($conf, $sessionManager, $loginManager) { - $response = $app->run(true); - // Hack to make Slim and Shaarli router work together: - // If a Slim route isn't found and NOT API call, we call renderPage(). --if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], '/api/v1') === false) { -+if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], $mountpoint) === false) { - // We use UTF-8 for proper international characters handling. - header('Content-Type: text/html; charset=utf-8'); - renderPage($conf, $pluginManager, $linkDb, $history, $sessionManager, $loginManager); diff --git a/overlays/slrn/default.nix b/overlays/slrn/default.nix deleted file mode 100644 index 1bf5fe2..0000000 --- a/overlays/slrn/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - slrn = super.slrn.overrideAttrs (old: rec { - configureFlags = old.configureFlags ++ [ "--with-slrnpull" ]; - }); -} diff --git a/overlays/taskwarrior/TW-1778_patch.diff b/overlays/taskwarrior/TW-1778_patch.diff deleted file mode 100644 index 6d7e376..0000000 --- a/overlays/taskwarrior/TW-1778_patch.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/text.cpp 2016-02-24 23:18:11.000000000 +0100 -+++ b/src/text.cpp 2020-02-26 18:53:15.869331031 +0100 -@@ -248,7 +248,7 @@ - // Premature EOL. - if (character == '\n') - { -- line = text.substr (offset, line_length); -+ line = text.substr (offset, prior_cursor-offset); - offset = cursor; - return true; - } - diff --git a/overlays/taskwarrior/default.nix b/overlays/taskwarrior/default.nix deleted file mode 100644 index 9ca52b8..0000000 --- a/overlays/taskwarrior/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -self: super: -{ - taskwarrior = super.taskwarrior.overrideAttrs (old: { - patches = old.patches or [] ++ [ - ./TW-1778_patch.diff - ]; - postInstall = ''${old.postInstall} - mkdir -p "$out/share/vim/vimfiles/ftdetect" - mkdir -p "$out/share/vim/vimfiles/syntax" - ln -s "../../../../share/doc/task/scripts/vim/ftdetect/task.vim" "$out/share/vim/vimfiles/ftdetect/" - ln -s "../../../../share/doc/task/scripts/vim/syntax/taskrc.vim" "$out/share/vim/vimfiles/syntax/" - ln -s "../../../../share/doc/task/scripts/vim/syntax/taskdata.vim" "$out/share/vim/vimfiles/syntax/" - ln -s "../../../../share/doc/task/scripts/vim/syntax/taskedit.vim" "$out/share/vim/vimfiles/syntax/" - ''; - }); -} diff --git a/overlays/vcsh/default.nix b/overlays/vcsh/default.nix deleted file mode 100644 index eb4d48e..0000000 --- a/overlays/vcsh/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -self: super: { - vcsh = super.vcsh.overrideAttrs(old: { - patchPhase = old.patchPhase or "" + '' - sed -i -e 's@-r "$XDG_CONFIG_HOME/vcsh/config.d/$VCSH_REPO_NAME"@-f "$XDG_CONFIG_HOME/vcsh/config.d/$VCSH_REPO_NAME"@' vcsh - ''; - }); -} diff --git a/overlays/weechat/default.nix b/overlays/weechat/default.nix deleted file mode 100644 index e8cc792..0000000 --- a/overlays/weechat/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -self: super: { - weechat = super.weechat.override { - configure = { availablePlugins, ... }: { - plugins = with self; with availablePlugins; [ - (python.withPackages (ps: with ps; [websocket_client emoji])) - perl - ruby - ]; - }; - }; - -} diff --git a/overlays/ympd/default.nix b/overlays/ympd/default.nix deleted file mode 100644 index dda17aa..0000000 --- a/overlays/ympd/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -self: super: { - ympd = super.ympd.overrideAttrs(old: self.mylibs.fetchedGithub ./ympd.json // { - patches = (old.patches or []) ++ [ ./ympd-password-env.patch ]; - }); -} diff --git a/overlays/ympd/ympd-password-env.patch b/overlays/ympd/ympd-password-env.patch deleted file mode 100644 index 2bbe188..0000000 --- a/overlays/ympd/ympd-password-env.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/ympd.c b/src/ympd.c -index 3aed7e6..b3b6fda 100644 ---- a/src/ympd.c -+++ b/src/ympd.c -@@ -71,6 +71,7 @@ int main(int argc, char **argv) - char *run_as_user = NULL; - char const *error_msg = NULL; - char *webport = "8080"; -+ const char *s; - - atexit(bye); - #ifdef WITH_DYNAMIC_ASSETS -@@ -92,6 +93,10 @@ int main(int argc, char **argv) - {0, 0, 0, 0 } - }; - -+ if ((s = getenv("MPD_PASSWORD")) != NULL) { -+ mpd.password = strdup(s); -+ } -+ - while((n = getopt_long(argc, argv, "h:p:w:u:vm:", - long_options, &option_index)) != -1) { - switch (n) { diff --git a/overlays/ympd/ympd.json b/overlays/ympd/ympd.json deleted file mode 100644 index 51f06d5..0000000 --- a/overlays/ympd/ympd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tag": "612f8fc-master", - "meta": { - "name": "ympd", - "url": "https://github.com/notandy/ympd", - "branch": "master" - }, - "github": { - "owner": "notandy", - "repo": "ympd", - "rev": "612f8fc0b2c47fc89d403e4a044541c6b2b238c8", - "sha256": "01hnj10zl103mrn82vyd42fvq7w5az3jf1qz18889zv67kn73ll9", - "fetchSubmodules": true - } -} -- cgit v1.2.3