Workout Export

The process of upgrading the underlying server for this site has quite a few manual tasks, one being exporting any PierWorkout. When running PRKernelCreatorForPier, any PRWorkoutLog has the workouts exported as an array of PRExerciseEntries, like:

structure workouts: #(5 sets on 1 June 2015 6 sets on 3 June 2015

Initially I had planned to build a parser to use a state machine and read in each entry building up a workout. Then I saw it would be easier to modify how it is printed in:


These now display a workout with the same format used for testing in PRWorkoutTest. Modifying PRWorkoutLog>>workouts: as:

	workouts := (aCollectionOfPRWorkouts asOrderedCollection
		collectAll: [ :e |
			e isString
				ifTrue: [ self class workoutsBasedOnString: e ]
				ifFalse: [ OrderedCollection with: e ] ])
		sorted: [ :a :b | a date < b date ]
Posted by John Borden at 11 June 2021, 12:26 pm link

Rename Banch to Main

While working through an user-add issue in Pier, I decided to rename the primary branch from master to main. Personally I don't have strong feelings concerning the name, however if it makes others feel more comfortable contributing to a project that doesn't conjure up master/slave images, then it is worth the effort.

One nice aspect of Pier is that it allows pages to be embedded in other pages, which reduces the number of updates. An example is:

The Loading with Metacello core version 3.2 can be loaded from GitHub using Metacello:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

The #onConflict... code is due to a Grease version mismatch between Seaside and Magritte.

For the full install with all the addons, it can be loaded with:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

The PierToDo code depends on the add-ons, it can be loaded with:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

Posted by John Borden at 13 May 2021, 3:30 am link

Displaying Variables in Pier

If one wants to list ksh variables in Pier (or any dollar-bracket text), then there can be issues if the line is not preformatted. This can be saved in an editor:

text \${bracket-text} other
text $\{bracket-text} other
text \$\{bracket-text} other

They are each displayed as:

text ${bracket-text} other

However if one removes the back-slashes and saves the text (but not as a line starting with an equal sign to make it preformatted) then it generates a walkback:

Seaside Walkback - PRSyntaxError Pillar does not support this tag
This is only a problem for users logged in and using Pier-Addons. If basic Pier is used (without loading the enhanced editor in PierAddons) the problem text causes it to display the editor with the error:

Contents: Invalid input given

For blog comments and other text fields, the enhanced editor isn't opened.

It seemed like fixing this could be resolved by catching the exception and adding a backslash before the dollar sign. This can be changed in PRWysiwygEditor>>#document, however it causes the same invalid input error, but at least it does not open a walkback. A long-term fix for this would likely be replacing the YUI editor.

Posted by John Borden at 10 April 2021, 3:28 pm link

HR1 Voting Rights Act

Adam Serwer's US election piece from 2016 starts with a very interesting fact:

Between 1870 and 1901, there were 20 black representatives in Congress and two black United States senators. Between 1901 and 1929, there were none.

This is generally attributed to the Jim Crow laws particularly related to voting.

Since the start of the 2020 election, there are a large number of new state bills related to restricting voting, the Brennan Center lists up to February. Once a state has enacted stringent rules for voting, removing those rules is not in the interest of those in power.

The federal HR 1 bill has several features:

  • it eliminates partisan gerrymandering
  • improves election security by requiring a physical paper trail for each ballot, requires states to accept absentee and early voting for federal elections
  • adds restrictions on Corporate PACs, reducing money in politics

The Wikipedia page has an excellent summary. When I contacted my congressman Rodney Davis about this bill, he sent the following:

Thank you for contacting me regarding your support for H.R. 1, the For the People Act. I appreciate the time you took to share your thoughts on this important issue.

As your Member of Congress, it is part of my constitutional responsibility to ensure fair elections. Campaign finance reform should not be partisan. However, H.R. 1 lacks the bipartisan compromise necessary for lasting change and contains provisions harmful to our democracy.

Our campaign finance laws need be reviewed, yet H.R. 1 takes it too far by publicly subsidizing campaigns. Under H.R. 1, the federal government would provide a 6 to 1 match on campaign contributions up to $200. This means that last year taxpayers would have provided my campaign with nearly $1 million of your money, regardless of your support. For this reason alone, H.R. 1 is unacceptable.

I believe Republicans and Democrats alike want to ensure every person who is eligible has the opportunity to cast a vote. I also believe it is imperative we focus on ensuring our voter registration data throughout the country is secure. For this reason, I have communicated with the Illinois State Board of Elections, to give them the support and resources necessary to secure future elections. However, H.R. 1 would allow the federal government to take over local elections and centralize all data online, making elections more vulnerable to foreign interference.

For these reasons, I urge my colleagues to work in a bipartisan manner on the issue of election reform and to re-engage with Republicans to provide lasting change. I appreciate your views on this matter. Please be assured, I will keep your thoughts in mind for future legislation on this issue in the House of Representatives.

Rep. Davis statement on subsidizing campaign with tax dollars is false, it is funded from fines and penalties from bank and corporation crime. This shows another reason why H.R.1 is needed - as long as large-dollar donors aren't linked to the lies their politicians tell, they have a pay-to-play government (this is supported by a New Yorker article).

H.R.1 benefits

Posted by John Borden at 25 March 2021, 2:33 am link

Serving Pier with HTTPS

For reading this wiki, I'm fine to use unencrypted HTTP, however for logging in and editing pages, it seems better to use HTTPS. For making this change, I've done the following:

Open Connectivity

For security, I use security groups in AWS. To prevent issues with the next steps, an entry was added to allow incoming traffic on port 443.

Request SSL Certificates from Let's Encrypt

The site https://letsencrypt.org provides the files, installed with:

ubuntu@ip-172-31-43-26:~$ sudo snap install --classic certbot
certbot 1.11.0 from Certbot Project (certbot-eff✓) installed

After reading and aggreeing to the subscriber agreement, the script had errors with my NGinX config:

Account registered.
No names were found in your configuration files. Please enter in your domain

This did setup the certs in the proper directory despite the error.

NGinX Configuration Updates

These are described on NGinX in Front of Pier, specifically:

  • turning off server_tokens should help with security
  • adding a listener for SSL on port 443
  • really large pages can take Pier more than one minute to bring up. The proxy timeout of 300 prevent NGiNX from displaying a gateway error
Posted by John Borden at 3 February 2021, 10:26 pm link
<< 1 2 3 4 5 6 7 8 9 10 >>