Skip to content

Commit 50f95f2

Browse files
Merge pull request #255 from CodeForPhilly/develop
Release: v3.1.2
2 parents bbd81ed + 4e5d21d commit 50f95f2

File tree

7 files changed

+187
-1
lines changed

7 files changed

+187
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[holomapping]
2+
root = "fixtures"
3+
files = "**/*.sql"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Update SAML2 Certificate
2+
3+
The OpenSSL certificate used by Laddr's Single Sign-On (SSO) integration with Slack needs to be refreshed occasionally when it nears or passes its expiration date
4+
5+
## Generate a new certificate
6+
7+
On any computer with the `openssl` command installed (readily available on macOS and Linux), you can generate the new key+certificate pair before installing it to your Slack and Laddr instances:
8+
9+
1. Generate private key:
10+
11+
```bash
12+
openssl genrsa \
13+
-out ./laddr-slack-private-key.pem \
14+
1024
15+
```
16+
17+
2. Generate public certificate:
18+
19+
```bash
20+
openssl req -new -x509 \
21+
-days 1095 \
22+
-key ./laddr-slack-private-key.pem \
23+
-out ./laddr-slack-public-cert.pem
24+
```
25+
26+
*Fill out the prompts with appropriate information about your organization. These values don't really matter for anything*
27+
28+
3. If your Laddr instance is hosted on Kubernetes, encode the two generated files into a `Secret` manifest (you only need the `kubectl` command installed on your local system for this, it does *not* need to be connected to any cluster):
29+
30+
```bash
31+
kubectl create secret generic saml2 \
32+
--output=yaml \
33+
--dry-run \
34+
--from-file=SAML2_PRIVATE_KEY=./laddr-slack-private-key.pem \
35+
--from-file=SAML2_CERTIFICATE=./laddr-slack-public-cert.pem \
36+
> ./saml2.secret.yaml
37+
```
38+
39+
4. If your cluster uses [sealed secrets](http://civic-cloud.phl.io/development/features/sealed-secrets/), seal the newly-created secret:
40+
41+
```bash
42+
export SEALED_SECRETS_CERT=https://sealed-secrets.live.k8s.phl.io/v1/cert.pem
43+
kubeseal \
44+
--namespace "my-project" \
45+
-f ./saml2.secret.yaml \
46+
-w ./saml2.sealed-secret.yaml
47+
```
48+
49+
*Be sure to replace `my-project` with the namespace your instance is deployed within*
50+
51+
5. Deploy the sealed secret to your cluster
52+
53+
*In Code for Philly's case, that means updating [`saml2.yaml`](https://github.com/CodeForPhilly/cfp-live-cluster/blob/main/code-for-philly.secrets/saml2.yaml) with the new content and then merging the generated deploy PR. After the deploy, you may need to delete the existing secret in order for the `sealed-secrets` operator to replace it with the updated secret*
54+
55+
6. Finally, visit <https://my-org.slack.com/admin/auth/saml?sudo=1> and edit the **Public Certificate**, pasting the contents of `./laddr-slack-public-cert.pem`:
56+
57+
```bash
58+
cat ./laddr-slack-public-cert.pem
59+
# paste output to Slack admin webpage
60+
```
61+
62+
*Slack will not let you save the new public certificate until it's been successfully applied to the host*

fixtures/project_buzz.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*!40103 SET TIME_ZONE='+00:00' */;
2+
/*!40101 SET character_set_client = utf8 */;
3+
4+
CREATE TABLE `project_buzz` (
5+
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6+
`Class` enum('Laddr\\ProjectBuzz') NOT NULL,
7+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
`CreatorID` int(11) DEFAULT NULL,
9+
`ProjectID` int(10) unsigned NOT NULL,
10+
`Handle` varchar(255) NOT NULL,
11+
`Headline` varchar(255) NOT NULL,
12+
`URL` varchar(255) NOT NULL,
13+
`Published` timestamp NOT NULL,
14+
`ImageID` int(10) unsigned DEFAULT NULL,
15+
`Summary` text,
16+
PRIMARY KEY (`ID`),
17+
UNIQUE KEY `Handle` (`Handle`),
18+
KEY `ProjectID` (`ProjectID`)
19+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
20+
21+
INSERT INTO `project_buzz` VALUES (1,'Laddr\\ProjectBuzz','2022-10-05 00:42:40',2,1,'laddr_v3.1.1_released','Laddr v3.1.1 released!','https://github.com/CodeForPhilly/laddr/releases/tag/v3.1.1','2022-08-06 19:15:00',NULL,'## Technical\r\n\r\n- chore(deps): bump emergence-slack to v1.0.2 @themightychris');

fixtures/project_members.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*!40103 SET TIME_ZONE='+00:00' */;
2+
/*!40101 SET character_set_client = utf8 */;
3+
4+
CREATE TABLE `project_members` (
5+
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6+
`Class` enum('Laddr\\ProjectMember') NOT NULL,
7+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
`CreatorID` int(11) DEFAULT NULL,
9+
`ProjectID` int(10) unsigned NOT NULL,
10+
`MemberID` int(10) unsigned NOT NULL,
11+
`Role` varchar(255) DEFAULT NULL,
12+
PRIMARY KEY (`ID`),
13+
UNIQUE KEY `ProjectMember` (`ProjectID`,`MemberID`)
14+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
15+
16+
INSERT INTO `project_members` VALUES (1,'Laddr\\ProjectMember','2022-10-05 00:41:02',2,1,2,'Founder');

fixtures/project_updates.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*!40103 SET TIME_ZONE='+00:00' */;
2+
/*!40101 SET character_set_client = utf8 */;
3+
4+
CREATE TABLE `project_updates` (
5+
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6+
`Class` enum('Laddr\\ProjectUpdate') NOT NULL,
7+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
`CreatorID` int(11) DEFAULT NULL,
9+
`Modified` timestamp NULL DEFAULT NULL,
10+
`ModifierID` int(10) unsigned DEFAULT NULL,
11+
`ProjectID` int(10) unsigned NOT NULL,
12+
`Number` int(10) unsigned NOT NULL,
13+
`Body` text NOT NULL,
14+
PRIMARY KEY (`ID`),
15+
KEY `ProjectID` (`ProjectID`)
16+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
17+
18+
INSERT INTO `project_updates` VALUES (1,'Laddr\\ProjectUpdate','2022-10-05 00:41:20',2,NULL,NULL,1,1,'Today we set up sample data to add to the project repository');
19+
20+
21+
CREATE TABLE `history_project_updates` (
22+
`RevisionID` int(10) unsigned NOT NULL AUTO_INCREMENT,
23+
`ID` int(10) unsigned NOT NULL,
24+
`Class` enum('Laddr\\ProjectUpdate') NOT NULL,
25+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
26+
`CreatorID` int(11) DEFAULT NULL,
27+
`Modified` timestamp NULL DEFAULT NULL,
28+
`ModifierID` int(10) unsigned DEFAULT NULL,
29+
`ProjectID` int(10) unsigned NOT NULL,
30+
`Number` int(10) unsigned NOT NULL,
31+
`Body` text NOT NULL,
32+
PRIMARY KEY (`RevisionID`),
33+
KEY `ID` (`ID`)
34+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
35+
36+
INSERT INTO `history_project_updates` SELECT NULL AS RevisionID, project_updates.* FROM `project_updates`;

fixtures/projects.sql

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*!40103 SET TIME_ZONE='+00:00' */;
2+
/*!40101 SET character_set_client = utf8 */;
3+
4+
CREATE TABLE `projects` (
5+
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6+
`Class` enum('Laddr\\Project') NOT NULL,
7+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
`CreatorID` int(11) DEFAULT NULL,
9+
`Modified` timestamp NULL DEFAULT NULL,
10+
`ModifierID` int(10) unsigned DEFAULT NULL,
11+
`Title` varchar(255) NOT NULL,
12+
`Handle` varchar(255) NOT NULL,
13+
`MaintainerID` int(10) unsigned DEFAULT NULL,
14+
`UsersUrl` varchar(255) DEFAULT NULL,
15+
`DevelopersUrl` varchar(255) DEFAULT NULL,
16+
`README` text,
17+
`NextUpdate` int(10) unsigned NOT NULL DEFAULT '1',
18+
`Stage` enum('Commenting','Bootstrapping','Prototyping','Testing','Maintaining','Drifting','Hibernating') NOT NULL DEFAULT 'Commenting',
19+
`ChatChannel` varchar(255) DEFAULT NULL,
20+
PRIMARY KEY (`ID`),
21+
UNIQUE KEY `Handle` (`Handle`)
22+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
23+
24+
INSERT INTO `projects` VALUES (1,'Laddr\\Project','2022-10-05 00:41:02',2,'2022-10-05 00:41:20',2,'Laddr','laddr',2,'http://codeforphilly.github.io/laddr/','https://github.com/CodeForPhilly/laddr',NULL,2,'Maintaining','laddr');
25+
26+
27+
CREATE TABLE `history_projects` (
28+
`RevisionID` int(10) unsigned NOT NULL AUTO_INCREMENT,
29+
`ID` int(10) unsigned NOT NULL,
30+
`Class` enum('Laddr\\Project') NOT NULL,
31+
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
32+
`CreatorID` int(11) DEFAULT NULL,
33+
`Modified` timestamp NULL DEFAULT NULL,
34+
`ModifierID` int(10) unsigned DEFAULT NULL,
35+
`Title` varchar(255) NOT NULL,
36+
`Handle` varchar(255) NOT NULL,
37+
`MaintainerID` int(10) unsigned DEFAULT NULL,
38+
`UsersUrl` varchar(255) DEFAULT NULL,
39+
`DevelopersUrl` varchar(255) DEFAULT NULL,
40+
`README` text,
41+
`NextUpdate` int(10) unsigned NOT NULL DEFAULT '1',
42+
`Stage` enum('Commenting','Bootstrapping','Prototyping','Testing','Maintaining','Drifting','Hibernating') NOT NULL DEFAULT 'Commenting',
43+
`ChatChannel` varchar(255) DEFAULT NULL,
44+
PRIMARY KEY (`RevisionID`),
45+
KEY `ID` (`ID`)
46+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
47+
48+
INSERT INTO `history_projects` SELECT NULL AS RevisionID, projects.* FROM `projects`;

html-templates/project-buzz/projectBuzzSaved.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{block title}{_ 'Buzz Saved'} &mdash; {$dwoo.parent}{/block}
44

55
{block content}
6-
{capture assign=buzzHeadlineLink}<a href="{$data->getURL()}">{$data->Headline|escape}</a> {tif $data->isNew ? {_ posted} : {_ updated}}{/capture}
6+
{capture assign=buzzHeadlineLink}<a href="{$data->getURL()}">{$data->Headline|escape}</a> {tif $data->isNew ? _('posted') : _('updated')}{/capture}
77
{capture assign=projectNameLink}{projectLink $data->Project}{/capture}
88
<p>{sprintf(_("%s for %s"), $buzzHeadlineLink, $projectNameLink)}</p>
99
{/block}

0 commit comments

Comments
 (0)